自定义的php.ini每目录(用于测试的网站) [英] Custom php.ini per-directory (for testing sites)
问题描述
我运行的Apache 2.26,在Windows 7上使用PHP 5.39了mod_ssl / 2.2.6的OpenSSL / 0.9.8g。
I'm running Apache 2.26, on Windows 7 with PHP 5.39 mod_ssl/2.2.6 OpenSSL/0.9.8g .
PHP工作正常,那么确实阿帕奇。
PHP works fine, so does Apache.
不过,我想尝试和每个目录下创建自定义的php.ini文件,我的测试站点。
However, I want to try and create custom php.ini files per directory, for my test sites.
我可以 - 而且确实 - 使用的php_flag但想尝试创建工作自定义的php.ini文件。我试图谷歌这一点,但无法找到任何有关。
I could - and did - use php_flag but would like to try to create a custom php.ini file that works. I tried to Google this, but couldn't find anything relevant.
这是我目前的.htaccess为C:/ WWW /虚拟主机/本地主机/ testsite1:
This is my current .htaccess for C:/www/vhosts/localhost/testsite1:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
#RewriteCond %{REQUEST_fileNAME} !\.php -f
#RewriteRule .* index.php
AddType text/html .asp
AddHandler application/x-httpd-php .page
php_value include_path "./php:/php/"
不过,我做在PHP中自定义的php.ini的变化有短标签关闭[仅用于测试],但它并没有把它捡起来,PHP的code表现吧。
Yet, I made a change in the custom php.ini within the php to have short tags off [for testing only] but it didn't pick it up, the php code showed instead.
任何帮助是pciated这个AP $ P $;这将是非常有用的!
Any help is appreciated with this; it'll be extremely useful!
(记住,这Apache的安装是一家集开发/测试一个)
(bear in mind, this Apache install is a development/testing one)
推荐答案
。自定义的php.ini文件不支持这一点。您需要使用suPHP或当量为的php.ini
只加载在PHP启动,这是不是的每个请求的为mod_php5和FCGI。
If you are using php_flag
then you are probably using mod_php5. Custom 'php.ini' files aren't supported with this. You would need to use suPHP or equiv as the php.ini
is only loaded at PHP startup, and this isn't per-request for mod_php5 and FCGI.
然而的,因为你正在使用PHP 5.3,你也可以使用的 .user.ini文件这些分析对每个请求的基础。
However, since you are using PHP 5.3 you can also use .user.ini files which are parsed on a per-request basis.
这篇关于自定义的php.ini每目录(用于测试的网站)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!