Can you disable registered globals for just one account?

LinuxTechie

Well-Known Member
Jan 22, 2011
502
10
68
cPanel Access Level
Root Administrator
Hello Charles,

It depends on the PHP build. If PHP is build as Apache you can turn off register globals via htaccess. If PHP is build as suphp you need to use custom php.ini for the purpose.
 

WebHostPro

Well-Known Member
PartnerNOC
Jul 28, 2002
1,715
28
328
LA, Costa RIca
cPanel Access Level
Root Administrator
Twitter
Hello Charles,

You are entirely welcome. You can always copy the server's php.ini to user's public_html or the required directory!
I did exactly that but they said it's not taking. I heard adding this to the htaccess will work: AddType x-mapp-php5 .php

I give that a try.
 

LinuxTechie

Well-Known Member
Jan 22, 2011
502
10
68
cPanel Access Level
Root Administrator
Hey Charles,

Did you check the phpinfo of the domain to check from where the domain is taking php.ini?

If it is not working you can use the below given steps to make the domain take php.ini from public_html of the domain.

Create a file called php5.cgi under the public_html directory of the user. The php5.cgi must contain the following code in it.

#!/bin/sh
exec /usr/local/cpanel/cgi-sys/php5 -c /home/username/php.ini

chmod 755 /home/username/public_html/php5.cgi
chown username.username /home/username/public_html/php5.cgi

Create a .htaccess in the directory you need custom php5 configuration working with the following code in it.

Options All -Indexes
AddHandler application/x-httpd-php5 .php
Action application/x-httpd-php5 /php5.cgi

Make sure both .htaccess and php5.cgi are in the document root.

After that you can test it by putting a phpinfo() file in that directory and accessing it via browser. It should show the path to php.ini as /home/username/php.ini