Current time: 11-11-2024, 09:01 AM Hello There, Guest! (LoginRegister)


Post Reply 
Change register_globals?
Author Message
Eminos Offline
Junior Member
*

Posts: 159
Joined: Jan 2007
Reputation: 0
Post: #1
Change register_globals?
Hi there,

I need to set register_globals to ON for some scripts. On Debian Sarge (my old server) I could just put an .htaccess file with php_flag register_globals On in that directory where I had that script. But this doesn't work anymore (is it any difference now because I run php5 with fcgi?)

I tried adding the line register_globals On in both the domain specific php.ini and the "global" in etc/php5/cgi/php.ini. No change. Stil shows up as "Off".

Of course I restarted apache2 between changes Smile

/E
05-24-2007 09:34 PM
Find all posts by this user Quote this message in a reply
SunDanCe Offline


Posts: 2
Joined: Mar 2007
Reputation: 3
Post: #2
RE: Change register_globals?
Eminos Wrote:Hi there,

I need to set register_globals to ON for some scripts. On Debian Sarge (my old server) I could just put an .htaccess file with php_flag register_globals On in that directory where I had that script. But this doesn't work anymore (is it any difference now because I run php5 with fcgi?)

I tried adding the line register_globals On in both the domain specific php.ini and the "global" in etc/php5/cgi/php.ini. No change. Stil shows up as "Off".

Of course I restarted apache2 between changes Smile

/E

take a look in /var/www/fcgi/domain.tld/php5/php.ini
in that file you can change php values only for that domain, if you want to do it for everyone (i do not recommed it) just edit /var/www/fcgi/master/...


Best Regards
05-24-2007 09:38 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Eminos Offline
Junior Member
*

Posts: 159
Joined: Jan 2007
Reputation: 0
Post: #3
RE: Change register_globals?
As I said, I've already tried that.
But in that domain specific php.ini there IS NO register_globals string, so I added it, but still no luck.

/E
05-24-2007 09:42 PM
Find all posts by this user Quote this message in a reply
BeNe Offline
Moderator
*****
Moderators

Posts: 5,899
Joined: Jan 2007
Reputation: 68
Post: #4
RE: Change register_globals?
Yeah, i also started to test override the php setting with a .htaccess and i always get an Internal Error 500 !

I tested this one:

Code:
#
# Set
#
<Directory "/var/www/virtual/mydomain.com/htdocs">
AllowOverride FileInfo
#
# to enable parsing off this file
#
php_value memory_limit 32M
php_value max_execution_time 60
php_flag register_globals Off
php_flag magic_quotes_gpc Off
php_flag magic_quotes_runtime Off
# settings for the file upload, you might increase them further
php_value upload_max_filesize 16M
# session handling: now the check for expired sessions is done on every 10th session creation
php_flag session.use_trans_sid Off
php_value session.gc_probability 1
php_value session.gc_divisor 10
# multibyte extension: needed for utf-8
php_value mbstring.func_overload 7
</Directory>
05-24-2007 09:57 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Eminos Offline
Junior Member
*

Posts: 159
Joined: Jan 2007
Reputation: 0
Post: #5
RE: Change register_globals?
I get error 500 with that in the htaccess file.

Error log:
/var/www/virtual/domain.net/htdocs/whmcs/.htaccess: <Directory not allowed here

Actually I don't get the 500 error when just having the php_flag register_globals On in the htaccess, It's just that it doesn't "adapt", my script still shows as register_globals Off.

/E
05-24-2007 10:04 PM
Find all posts by this user Quote this message in a reply
Eminos Offline
Junior Member
*

Posts: 159
Joined: Jan 2007
Reputation: 0
Post: #6
RE: Change register_globals?
Ok, I found part of the problem.

It was the php4 php.ini I had to edit !! .. Even tho I use php5 (hack from FAQ section).

But still. I want to use htacess file in just that directory, instead of the domain specific php.ini.

/E
(This post was last modified: 05-24-2007 10:12 PM by Eminos.)
05-24-2007 10:11 PM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #7
RE: Change register_globals?
php settings in .htaccess file or direct in the apache conf (see post from BeNe) don't work with phpfcgi.
Since php is fully separated from the rest of apache.

The only thing you can do is creating different fastcgi prozesses (starters) and put the thin in the respective php.ini...
05-25-2007 04:18 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Eminos Offline
Junior Member
*

Posts: 159
Joined: Jan 2007
Reputation: 0
Post: #8
RE: Change register_globals?
Oh, ok, then I know, thanks Smile

So .. what is the advantage of running php via fcgi ? Is it JUST that we can choose betwen php4 and php5, or is it something else ?

/E
05-25-2007 04:24 AM
Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #9
RE: Change register_globals?
It's the fact that the php scripts will run with the ownership and permissions of the vuXXXX user (with mod_php all php were running as apache user and when uploading files with ftp and then changing theese files with php you always have problems (or you chmod to 777 which is not good either).
So, it's security. You even could disable openbase_dir - the user vu2001 cannot see the php files from vu2002 and therefore it should be possible to protect the config files better...

This is a big thing for ISP with moe than a cuple of foreign customers...

It's maybe easier with mod_php - and if it's only you on the machine and maybe you friends then there is no reason why not to go back to mod-php.

And, there is another thing: Since mod-php cannot be used in the mpm-worker of apache you loose some performing advantages of threads which were available since apache2 but not usable because of mod-php...

hope that's it...
05-25-2007 04:42 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Eminos Offline
Junior Member
*

Posts: 159
Joined: Jan 2007
Reputation: 0
Post: #10
RE: Change register_globals?
You're the man joximu !

Maybe you wanna develop the mpm-worker thing? I know there is mpm-worker and threaded, but what is it actually ?

/E - *like to learn* ^^
05-25-2007 04:46 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)