php-general Digest 3 Apr 2004 16:15:45 -0000 Issue 2684

Topics (messages 182235 through 182254):

Re: Global $_FILEs
        182235 by: Jason Wong

Re: Problem sending with mail()
        182236 by: Jason Wong

Re: php email functionality
        182237 by: Jason Wong
        182242 by: Burhan Khalid

Re: I can't view files uploaded with PHP
        182238 by: Jason Wong

Re: Apache version... 1.3.29 vs 2.0.
        182239 by: Jason Wong

Re: Relative Url
        182240 by: K.Bogac Bokeer

Re: Configuration Variable user_agent
        182241 by: Burhan Khalid

how to reset PHP_AUTH vars
        182243 by: Nitin Mehta
        182247 by: Marek Kilimajer
        182249 by: Nitin Mehta

php_admin_value's from httpd.conf Override'd in .htaccess files
        182244 by: Juan Velasquez
        182248 by: Marek Kilimajer

Apache2.x and php4.x
        182245 by: Merlin
        182246 by: Burhan Khalid
        182251 by: Lester Caine

Installing php with curl and sablotron
        182250 by: Merlin

compiling php with sablot and curl
        182252 by: Merlin

Suddenly some errors are coming
        182253 by: Manisha Sathe

passing variables
        182254 by: klaus

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
On Saturday 03 April 2004 05:50, Bruno Santos wrote:

> i've tried to pass the global array $_FILES to a function

$_FILES is a superglobal and hence available everywhere (including the inside 
of functions) without any work on your part.

> but still no sucess...

Please elaborate.

> can someone help me ??

Only if you can provide some details:

1) State what you're trying to do
2) Show the code that you're using
3) State what you expect the code to do
4) State what the code is actually doing

If (3) and (4) are different then:
 
 i) Enable full error reporting and study any error messages you get
ii) Use print_r() and var_dump() to examine all your variables.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
A king's castle is his home.
*/

--- End Message ---
--- Begin Message ---
On Saturday 03 April 2004 03:35, Matt MacLeod wrote:

> I'm stumped. I have a script to send a simple email using the mail()
> function in PHP.
>
> For some reason I can only receive the email if I send it to my hotmail
> account. If I send to my regular email ([EMAIL PROTECTED]) I can't get
> it. I've also tried sending to other non-hotmail addresses with no
> luck.

What does the php error logs say?
And your mail logs?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
If the human brain were so simple that we could understand it,
we would be so simple we couldn't.
*/

--- End Message ---
--- Begin Message ---
On Saturday 03 April 2004 00:59, Shawn Beard wrote:
> I just tried downgrading to version 4.3.4 and it still does not work.

And presumably it had worked before you did the upgrade? The tone of your 
original post suggested that the upgrade broke the mail functionality?

Again:

> Are you positive you have made no other changes to your setup whilst
> upgrading php?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Murphy's Law is recursive.  Washing your car to make it rain doesn't work.
*/

--- End Message ---
--- Begin Message --- Shawn Beard wrote:
I just upgraded to PHP 4.3.5 and now my email functionality does not work. I do have the SMTP setting in the php.ini set up and did restart Apache. We are running a Windows 2000 server and Apache 2.0.49. Any ideas?

A few ideas/suggestions :


Does your smtp server require authentication before sending? If so, the default mail() function in PHP can't handle SMTP authentication. Could be that it changed since your upgrade.

Does turning up the error_reporting level (E_ALL) print any warnings/notices?

Can you ping the smtp server from your web server?

Do other (non-PHP) mail applications work?

Can you send mail using the same smtp server from a mail client running from the webserver?

Is it possible to scan the logs of the smtp server to see what is going on?

Hopefully these can lead you in the right direction.
--- End Message ---
--- Begin Message ---
On Saturday 03 April 2004 03:04, Linux Zero wrote:

> I write some PHP scripts for a system's module that allows the user to
> upload a file from his computer to the host. It works fine in a server with
> Linux   Apache   MySQL   PHP (LAMP) environment. I based on the examples of
> this page:
>
> http://www.php.net/manual/en/features.file-upload.php
>
> Las week we transfer the whole system to another server with the same
> environment, but now the uploaded files can't be viewed in the browser.
> That's because the file is uploaded with 640 permissions and can't be
> opened by the browser with a wwwrun user.
>
> We check in the old server and find that these uploaded files with 644
> permissions. I check the httpd.conf and php.ini files looking for something
> like a umask option, but I find nothing like that.

umask() and/or chmod()

However it is odd, files uploaded via HTTP should be owned by the "webserver", 
which in your case ought to be 'wwwrun'? What is the user that the webserver 
is running under and who is the owner of the uploaded files?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Your temporary financial embarrassment will be relieved in a surprising 
manner.
*/

--- End Message ---
--- Begin Message ---
On Saturday 03 April 2004 01:28, Chris Shiflett wrote:
> --- Frano ILICIC <[EMAIL PROTECTED]> wrote:
> > I just wonder what is the best apache version to run PHP 4.35?
> > Just wondering if there is an obvious choice?
>
> Maybe not obvious, but I think the best choice is the latest Apache 1.3.x.

But presumably one still has to wait for PHP 4.35 to be released ;-)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Nothing is as simple as it seems at first
        Or as hopeless as it seems in the middle
                Or as finished as it seems in the end.
*/

--- End Message ---
--- Begin Message --- I'm using this on Apache. You need to include 'inc/globals.php' in your script.

inc/globals.php
<?
require_once('functions.php');

define('RELPATH', GetRelativePath());
?>

inc/functions.php

function GetRelativePath() {

$RELPATH = str_replace(UpDirectory(__FILE__), '', dir_name($_SERVER['SCRIPT_NAME]));
$RELPATH = substr_count($RELPATH, '/');


        if ( $RELPATH>0 )
            $RELPATH = str_repeat('../', $RELPATH);
        else
            $RELPATH = '/';

        return ConvertSlashes($RELPATH);
    }


function UpDirectory($directory, $level=1) {


        while ( $level-- > 0 )
            $directory = dirname(dirname($directory));

        return ConvertSlashes($directory);
    }


function ConvertSlashes($st) {


        $st = str_replace('\\\\', '/', $st);
        $st = str_replace('\\', '/', $st);

        return $st;
    }


function dir_name($directory) {


        return ConvertSlashes(dirname($directory));
    }

Chris Thomas wrote:
Is there anyway that i can get a url relative to my server for a script that
is being run??

The script is being included in mulitple files and $_SERVER['SCRIPT_NAME']
just gives me the name of the file that is including the other scripts.
Also $_SERVER['SCRIPT_FILENAME'] is returning nothing.

Thanks

Chris

--- End Message ---
--- Begin Message --- Bernhard Kraft wrote:
Hallo !

I run PHP 4.1.2.

I want to set the user_agent which gets sent
along when fetching file via the fopen(...) call.

Normally this is "PHP/VERISON" in my case "PHP/4.1.2"

I want to set a different user_agent.

I *believe* you can set this via header(), but its still early here. A sure-fire way to find out is to see how snoopy (snoopy.sf.net) does it.


--
Burhan

--- End Message ---
--- Begin Message ---
Hello all,

I'm facing this problem and tried many solutions with no success. How do I reset the 
value of PHP_AUTH_USER and PW. 

I've tried session_destroy(), but as I'm not starting any session at all, it's not 
worth.

I've tried using random value to include in header.

Now what should I do? 

Thanx in adv for any suggestion/help
Nitin

--- End Message ---
--- Begin Message --- Nitin Mehta wrote:
Hello all,

I'm facing this problem and tried many solutions with no success. How do I reset the value of PHP_AUTH_USER and PW.

I've tried session_destroy(), but as I'm not starting any session at all, it's not worth.

I've tried using random value to include in header.

Now what should I do?

Thanx in adv for any suggestion/help
Nitin

Are you trying to logoff a user using http autheniation? Provide a logoff link in this form:


<a href="http://nonexistentuser:[EMAIL PROTECTED]">Logoff</a>

This sets the login credentials in the browser to nonexisting user, so your code will return 401 response and the browser will ask the user for username and password again.

I'm not sure if this method works in IE with the latest security patch installed. These should ignore username and password in links.
--- End Message ---
--- Begin Message ---
Hello,

Thanks for your reply. but what I'm looking for is, yes logoff the user, but
not making him/her click some link. I've this page and I want it to ask for
username & password whenever a user comes/comes back. Any suggestions?

Thanks anyway
Nitin

----- Original Message ----- 
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
To: "Nitin Mehta" <[EMAIL PROTECTED]>
Cc: "PHP List" <[EMAIL PROTECTED]>
Sent: Saturday, April 03, 2004 3:54 PM
Subject: Re: [PHP] how to reset PHP_AUTH vars


> Nitin Mehta wrote:
> > Hello all,
> >
> > I'm facing this problem and tried many solutions with no success. How do
I reset the value of PHP_AUTH_USER and PW.
> >
> > I've tried session_destroy(), but as I'm not starting any session at
all, it's not worth.
> >
> > I've tried using random value to include in header.
> >
> > Now what should I do?
> >
> > Thanx in adv for any suggestion/help
> > Nitin
>
> Are you trying to logoff a user using http autheniation? Provide a
> logoff link in this form:
>
> <a href="http://nonexistentuser:[EMAIL PROTECTED]">Logoff</a>
>
> This sets the login credentials in the browser to nonexisting user, so
> your code will return 401 response and the browser will ask the user for
> username and password again.
>
> I'm not sure if this method works in IE with the latest security patch
> installed. These should ignore username and password in links.
>

--- End Message ---
--- Begin Message ---
so, if I set php_admin_value open_basedir in httpd.conf,  and I give
.htaccess AllowOverride permissions,  can users Override the
open-basedir I set?   And, how can I give out some Override's, but not
php_admin_value's?

--- End Message ---
--- Begin Message --- Juan Velasquez wrote:
so, if I set php_admin_value open_basedir in httpd.conf, and I give
.htaccess AllowOverride permissions, can users Override the
open-basedir I set?

No


And, how can I give out some Override's, but not
php_admin_value's?


--- End Message ---
--- Begin Message --- Hi there,

I am just about to install a new server and I was wondering if php now workes fine with apache2.x. I remember that there have been problems some while ago. Is this fixed and is it good enough for production servers?

Thanx,

Merlin
--- End Message ---
--- Begin Message --- Merlin wrote:
Hi there,

I am just about to install a new server and I was wondering if php now workes fine with apache2.x. I remember that there have been problems some while ago. Is this fixed and is it good enough for production servers?

From http://www.php.net/manual/en/install.apache2.php :


The following versions of PHP are known to work with the most recent version of Apache 2.0:

* PHP 4.3.0 or later available at /downloads.php.
* the latest stable development version. Get the source code http://snaps.php.net/php4-latest.tar.gz or download binaries for Windows http://snaps.php.net/win32/php4-win32-latest.zip.
* a prerelease version downloadable from http://qa.php.net/.
* you have always the option to obtain PHP through anonymous CVS.


These versions of PHP are compatible to Apache 2.0.40 and later.

Note: Apache 2.0 SAPI-support started with PHP 4.2.0. PHP 4.2.3 works with Apache 2.0.39, don't use any other version of Apache with PHP 4.2.3. However, the recommended setup is to use PHP 4.3.0 or later with the most recent version of Apache2.

All mentioned versions of PHP will work still with Apache 1.3.x.

I think that about answers your question :)
--- End Message ---
--- Begin Message --- Burhan Khalid wrote:

Merlin wrote:

Hi there,

I am just about to install a new server and I was wondering if php now workes fine with apache2.x. I remember that there have been problems some while ago. Is this fixed and is it good enough for production servers?


From http://www.php.net/manual/en/install.apache2.php :

BUT the third line says:-


"Do not use Apache 2.0 and PHP in a production environment neither on Unix nor on Windows."

Not that I found until after I had already got a configured system running :)

Currently been running both PHP4.3.4 and PHP5RC1 24/7 on W2k with Apache2.0.48 and Firebird 1.5. No crashes in last two weeks and every error can be identified. So I don't think I will be changing to Apache1 any time soon ;)

On of the packages running is an ibWebAdmin demo and that is starting to see quite heavy use.
http://ibWebAdmin.lsces.co.uk


--
Lester Caine
-----------------------------
L.S.Caine Electronic Services

--- End Message ---
--- Begin Message --- Hi there,

thanx for the hint with apache2.x and php4.x.
I am now trying to build php, but the make command failes while configure did well?!

This is the cinfigure command I used:
'./configure' '--with-gd' '--with-freetype-dir=/usr/lib' '--enable-gd-native-ttf' '--enable-gd-imgstrttf' '--with-jpeg-dir=/usr' '--with-png-dir=/usr/lib' '--with-zlib' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-mysql' '--with-pdflib' '--with-xml' '--with-gettext' '--enable-sysvsem' '--enable-sysvshm' '--with-curl' '--enable-xslt' '--with-xslt-sablot=/usr/local/'


This is the error msg after running make:

RM  -g -O2  -prefer-pic -c /home/merlin/sw/php-4.3.5/ext/curl/curl.c -o 
ext/curl/curl.lo
cc1: warning: changing search order for system directory "/usr/local/include"
cc1: warning:   as it has already been specified as a non-system directory
/home/merlin/sw/php-4.3.5/ext/curl/curl.c: In function `curl_free_post':
/home/merlin/sw/php-4.3.5/ext/curl/curl.c:568: warning: passing arg 1 of 
`curl_formfree' from incompatible pointer type
/home/merlin/sw/php-4.3.5/ext/curl/curl.c: In function `alloc_curl_handle':
/home/merlin/sw/php-4.3.5/ext/curl/curl.c:608: sizeof applied to an incomplete type
/home/merlin/sw/php-4.3.5/ext/curl/curl.c: In function `zif_curl_setopt':
/home/merlin/sw/php-4.3.5/ext/curl/curl.c:845: duplicate case value
/home/merlin/sw/php-4.3.5/ext/curl/curl.c:700: previously used here
/home/merlin/sw/php-4.3.5/ext/curl/curl.c:890: warning: passing arg 1 of 
`curl_formadd' from incompatible pointer type
/home/merlin/sw/php-4.3.5/ext/curl/curl.c:890: warning: passing arg 2 of 
`curl_formadd' from incompatible pointer type
/home/merlin/sw/php-4.3.5/ext/curl/curl.c:898: warning: passing arg 1 of 
`curl_formadd' from incompatible pointer type
/home/merlin/sw/php-4.3.5/ext/curl/curl.c:898: warning: passing arg 2 of 
`curl_formadd' from incompatible pointer type
make: *** [ext/curl/curl.lo] Error 1


If I configure without curl, it still throws an error:


/usr/local/lib/libsablot.so: undefined reference to `operator new[](unsigned)'
/usr/local/lib/libsablot.so: undefined reference to `vtable for 
__cxxabiv1::__si_class_type_info'
/usr/local/lib/libsablot.so: undefined reference to `operator delete(void*)'
/usr/local/lib/libsablot.so: undefined reference to `__gxx_personality_v0'
/usr/local/lib/libsablot.so: undefined reference to `__cxa_pure_virtual'
/usr/local/lib/libsablot.so: undefined reference to `vtable for 
__cxxabiv1::__class_type_info'
/usr/local/lib/libsablot.so: undefined reference to `operator delete[](void*)'
/usr/local/lib/libsablot.so: undefined reference to `vtable for 
__cxxabiv1::__vmi_class_type_info'
/usr/local/lib/libsablot.so: undefined reference to `operator new(unsigned)'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

Has somebody an idea what to do?`

thanx for anny hint,

Merlin
--- End Message ---
--- Begin Message --- Hi there,

in my previous post I wrote that I tryed to install php4.x with apache2.x and it generated problems with a module.

Now I installed apache 1.3.29 and it still does throw the same errors during make of php4.x

My guess is that this is coused because I have compiled sablot and curl by hand, while 
it was already installed
and now the versions get into conflict. I dont know how to solve this.

This is what make says:

/home/merlin/sw/php-4.3.5/ext/curl/curl.c:898: warning: passing arg 2 of 
`curl_formadd' from incompatible pointer type
make: *** [ext/curl/curl.lo] Error 1


If I configure without curl another error exits the make:


/usr/local/lib/libsablot.so: undefined reference to `operator new(unsigned)'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

Has anybody an idea?

Many thanx in advance!

Merlin
--- End Message ---
--- Begin Message ---
I am having a login page which goes to login process file. I have a include
file which connects to database. Till now all was ok suddenly it started
showing following

---------------------------
Warning: main(): stream does not support seeking in
/home2/www/members/login-px.php on line 6
------------------------

This line is nothing but where i included my file for database connection.
My client got very upset, i am also not understanding why suddenly this
popped out when for last 6 months nothing was wrong.

I did not change anything neither my client. I tested db connection
separately - it is ok. Then what can be the problem? The environment is
Apache / MySQL / Linux / PHP.

Thanks in advance,

regards
manisha

--- End Message ---
--- Begin Message ---
newbie alarm :-)


Dear all,

I just set up Apache, PHP and MySQL.

When using a link like xxx.proceed.php?language=gbr
the 'proceed.php' script does not receive any $language variable.

Does someone know how to get it run?

Thanks in advance
Klaus

--- End Message ---

Reply via email to