Forum Moderators: coopster
I'm using Win XP with Apache 2 and PHP 5.1.4 and want to emulate what I've already configured successfully for my live site.
Since the environment is different (I use Apache as a module, my provider as a CGI) I struggle with configuring how to override php.ini for one directory and the ones below.
I've added either of these to .htaccess:
SetEnv PHPRC "C:\webserver\htdocs\www.xyz.com"
php_value include_path ".;C:\webserver\htdocs\www.xyz.com"
and in that directory there's a php.ini with just
include_path = ".;C:\webserver\htdocs\www.xyz.com\include"
However, I only get the dreaded
"Warning: ...failed to open stream: No such file or directory in..."
What am I missing?
Thanks!
SetEnv PHPR only works when you are running PHP as a CGI. Therefore the error you are getting is because it cannot find the file you are including in the directory you specified because you never actually set the include path correctly.
yes, I put in both when I wasn't sure which one was for the module version of Apache.
I just figured out my mistake - I thought I had to go down the same path as for the live server, ie. put path to php.ini into .htaccess and then the PHP include path into php.ini.
But the setting
php_value include_path ".;C:\webserver\htdocs\www.xyz.com"
already gives you the include path [slap forehead] and I just had to add the last bit to the directory where the includes actually were,
php_value include_path ".;C:\webserver\htdocs\www.xyz.com\include"
Thanks for your help!