• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

enable register_globals for a single domain.

P

prad

Guest
Hello,

I am using plesk v 8.3 on a debian server. The php-suexec is enabled on the server and register_globals is disabled server wide.

How do I enable it for a single domain ? I tried to put custom php.ini file in the documentroot of that domain, but that is not helping ... :( Enabling it in .htaccess is giving error, as the server is php suexec'ed.

Is there any way to achieve it ? Any suggestion is greatly appreciated.

Thanks,
Prasad.
 
Thank you for your update :)

But I think that is not the solution that I am looking for. The php on the server CGI, so any directive that we use in http or in htaccess results in error "incorrect or unknown configuration directive".

So we used to put a php.ini file in the home directory in our Cpanel servers and it used to work just great, but here it is not working ... :(

Thanks,
Prasad.
 
Plesk runs PHP as mod_php by default. You should be able to create a vhost.conf file in the domain's conf directory and put in something like this:

Code:
<Directory /var/www/vhosts/example.com/httpdocs>
php_admin_flag register_globals on
</Directory>

Then run websrvmng as instructed at the link I posted earlier and register_globals should be enabled on that domain.
 
yust do a

php_admin_flag register_globals on

in the vhost.conf, it will work ...
 
Ah ... I did the following like you mentioned.

Created a file vhost.conf in the conf directory, and added the following.

<Directory /var/www/vhosts/example.com/httpdocs>
php_admin_flag register_globals on
</Directory>

and ran the command /usr/local/psa/admin/sbin/websrvmng for that domain.

It resulted in apache failure...

---
Invalid command 'php_admin_flag', perhaps misspelled or defined by a module not included in the server configuration failed!
---

I removed it to make the web server up and running.

FYI, the php is running as cgi,

---
Server API CGI/FastCGI
---

Thanks,
Prasad.
 
It appears you cannot use php_admin_flag with CGI and php_flag also is not recognized in that case, nor are the keywords on and off. You could try setting php_value register_globals 1.
 
Thank you for all your help :)

Actually I found out a way to do it. I added the following lines in vhost.conf file.

<IfModule mod_suphp.c>
suPHP_ConfigPath /path/to/my/custom/php.ini/file
</IfModule>

and put a php.ini file with register_globals turned on in that folder and ran the command websrvmng for that domain.

It is working now.

Thanks,
Prasad.
 
I have a website that is ready for launch. We have a problem creating
subdomains on the site.
The script we're using is working on other servers, but on a specific one that
we want, the server doesn't let us write that forlder.

I heard that this is a common problem with the plesk we're using.
The server doesn't let us access the conf forlder, and gives us this error:

Unable to change directory to /conf/: ls_dir_wrapper() failed: filemng: opendir
failed: Permission denied

If you know what I'm talking about, please bid.
Thanks.
 
Back
Top