Load "php.ini" specific for a sub-domain

Asked

Viewed 373 times

1

To carry a php.ini customized for a sub-domain, I applied to .htaccess at the root of the sub-domain concerned the following code:

AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php.fcgi

The file only has these two lines.

It loads the settings in conditions and independently of the main domain, which I can see through the phpinfo().

Problem

With the line above present in .htaccess, I can no longer access the sub-domain, only being able to access it through the main domain followed by the folder where the sub-domain is:

Intended access:

http://sub.dominio.com/

Access that works with the directives above:

http://www.dominio.com/sub/

Note:
In the htaccess at the root of the main domain there are several directives for the use of mod_rewrite.c, mod_deflate.c, Options, IndexIgnore, Header, which, if relevant to the problem, I can add here.

Question

What is missing or I am doing wrong to lose direct access via sub-domain when I have both lines on .htaccess of the same?

1 answer

1

Use the directive PHPINIDir in the virtual host configuration of the site for which you want to specify a php.ini personalized.

<VirtualHost 1.2.3.4:80>
    PHPINIDir /var/www/web1
</VirtualHost>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.