PHP ini file per location

General discussion on Zend Server for IBM System i
Post Reply
joshdayberry
Posts: 7
Joined: Fri May 28, 2010 2:25 pm

PHP ini file per location

Post by joshdayberry » Wed Jun 16, 2010 6:19 pm

I am not able to modify php.ini settings per path on the i5 as described http://www.php.net/manual/en/ini.sections.php. The link mentions it should work with fastcgi, but I have not had any luck.

Example:
[PATH=/www/whatever]
auto_prepend_file=file.php

zend_i5
Posts: 158
Joined: Mon Mar 23, 2009 5:22 pm

Re: PHP ini file per location

Post by zend_i5 » Sun Jul 04, 2010 2:30 pm

Which version of PHP are you using? According to documentation, this feature is available in PHP 5.3.

joshdayberry
Posts: 7
Joined: Fri May 28, 2010 2:25 pm

Re: PHP ini file per location

Post by joshdayberry » Tue Jul 20, 2010 1:11 pm

We are running 5.3.1. My solution involved .user.ini files. I couldn't get it to work in the PHP.ini file. Thanks for your reply.

zend_i5
Posts: 158
Joined: Mon Mar 23, 2009 5:22 pm

Re: PHP ini file per location

Post by zend_i5 » Mon Jul 26, 2010 12:56 pm

Was Apache restarted?

Here is the sample that works in my server

1 Add to php.ini:
[PATH=/www/zendsvr/htdocs/forum]
auto_prepend_file=q.php

2 PHP scripts sources:
/www/zendsvr/htdocs/t.php: <?php echo "Just "; ?>
/www/zendsvr/htdocs/forum/q.php: <?php echo "Hello\n"; ?>


3.Run
http://i_address:10088/t.php
Hello

http://10.1.0.42:10088/forum/t.php
Just Hello

Post Reply