Hey all,
This is probably an easy question for you.
Apparently most hosting company was using php 4.* and just today decided to upgrade. I happened to go to my site 1 hour ago and saw all kind of warning messages where i would usually see my included pages.
So here's some detail. I have the latest version of Winlamp installed on my machine, which includes php 5.(somethin). For my site, i like to be organized. I keep all images in the "images" folder, css sheets and other scripting files in my "global" folder, and I keep all included pages in the "includes" folder. So to make the includes work properly on my machine, i have to edit the php.ini file and add my specific directory where i keep my included pages. The line of code to change is include_path = ".:/usr/lib/php:/usr/local/lib/php". I simply edited that path and added one more directory. Everything is cool.
Now for my live site online at the webhost. Back two years ago or so when i set this up, i remember calling them and asking how do i edit YOUR php.ini file on the sever. Obviously, i can't edit the main file. But apparently the way it was setup, they instructed me to make a file called php.ini and add the one line as follows:
include_path = ".:/usr/lib/php:/usr/local/lib/php:/usr/public_html/includes"
And this one line would someone, behind the scenes, override the include_path line on the main php.ini file for my account. And it did indeed work.
So today the upgraded and things went haywire. I'm getting error messages saying "Warning: include(header07.php) [function.include]: failed to open stream: No such file or directory in BLAHBLAHBLAH"
So bottom line, it is no longer taking that one line php.ini file at the root of my hosting folder and overriding the main php.ini file. As a result, it's unable to locate the requested included page(s).
What's happened here? Is this something different about php 5.* ?
This may be more of a hosting/install question and i'm on hold with them now. The main level of tech support, although helpful, did not know the answer.
Ideas?
Thanks for your help.
JonathanWell theres no such differences that it will behave like that. The way they added you your own php.ini support was probably a little bit "hacky" and now when they upgraded they forgot how they did it in the first place
Anyway, if you have the rights and server is running apache, you could add an .htaccess file to your web root and add the include path there:
php_value include_path .:/usr/lib/php:/usr/local/lib/php:/usr/public_html/includesOkay, problem is finally solved. Apparently with the new installation came a new place/location of where each user's home directory is. So the include_path listed previously, ":/usr/public_html/includes" was not working because this is not how their server was setup during the new install.?.
Either way, the had me change the php.ini to the following (of course, only the third directory is important to me, as this is where my includes are):
include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/MYUSERNAME/public_html/includes"
And regarding the comment about adding my own php.ini as a "hacky" way of doing it, maybe it is. I really don't know. What they did is edit my .htaccess file with some commands telling the server to pull the php.ini file that they instructed me to create. This being the case, your method seems cleaner, as it is not using a separate file; rather, it is all being done in one command.
But at least we're back up and working. Thanks for your quick response.
This is probably an easy question for you.
Apparently most hosting company was using php 4.* and just today decided to upgrade. I happened to go to my site 1 hour ago and saw all kind of warning messages where i would usually see my included pages.
So here's some detail. I have the latest version of Winlamp installed on my machine, which includes php 5.(somethin). For my site, i like to be organized. I keep all images in the "images" folder, css sheets and other scripting files in my "global" folder, and I keep all included pages in the "includes" folder. So to make the includes work properly on my machine, i have to edit the php.ini file and add my specific directory where i keep my included pages. The line of code to change is include_path = ".:/usr/lib/php:/usr/local/lib/php". I simply edited that path and added one more directory. Everything is cool.
Now for my live site online at the webhost. Back two years ago or so when i set this up, i remember calling them and asking how do i edit YOUR php.ini file on the sever. Obviously, i can't edit the main file. But apparently the way it was setup, they instructed me to make a file called php.ini and add the one line as follows:
include_path = ".:/usr/lib/php:/usr/local/lib/php:/usr/public_html/includes"
And this one line would someone, behind the scenes, override the include_path line on the main php.ini file for my account. And it did indeed work.
So today the upgraded and things went haywire. I'm getting error messages saying "Warning: include(header07.php) [function.include]: failed to open stream: No such file or directory in BLAHBLAHBLAH"
So bottom line, it is no longer taking that one line php.ini file at the root of my hosting folder and overriding the main php.ini file. As a result, it's unable to locate the requested included page(s).
What's happened here? Is this something different about php 5.* ?
This may be more of a hosting/install question and i'm on hold with them now. The main level of tech support, although helpful, did not know the answer.
Ideas?
Thanks for your help.
JonathanWell theres no such differences that it will behave like that. The way they added you your own php.ini support was probably a little bit "hacky" and now when they upgraded they forgot how they did it in the first place
Anyway, if you have the rights and server is running apache, you could add an .htaccess file to your web root and add the include path there:
php_value include_path .:/usr/lib/php:/usr/local/lib/php:/usr/public_html/includesOkay, problem is finally solved. Apparently with the new installation came a new place/location of where each user's home directory is. So the include_path listed previously, ":/usr/public_html/includes" was not working because this is not how their server was setup during the new install.?.
Either way, the had me change the php.ini to the following (of course, only the third directory is important to me, as this is where my includes are):
include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/MYUSERNAME/public_html/includes"
And regarding the comment about adding my own php.ini as a "hacky" way of doing it, maybe it is. I really don't know. What they did is edit my .htaccess file with some commands telling the server to pull the php.ini file that they instructed me to create. This being the case, your method seems cleaner, as it is not using a separate file; rather, it is all being done in one command.
But at least we're back up and working. Thanks for your quick response.