Over the last couple of days I have switched from Ubuntu 10.10 to OpenSUSE 11.4_x86_64bit. I really love it and am impressed that Google chose this platform for their ChromeOS. My question is this: I just finished installing my LAMP server and I’m getting results from the files I had saved from my Ubuntu LAMP server. However, I can’t seem to get the file string right for my PHP include functions. With Ubuntu the path was written like this <?php include("file:///var/www/test/RHphp/titleheros.php. After getting everything running I would have suspected that the path on OpenSUSE would be <?php include("file:///srv/www/htdocs/test/RHphp/titleheros.php but this doesn’t seem to be working when I browse localhost. I don’t recall ever having to configure the php.ini file or anything like that. Can someone help me with what I’m missing please?
I will be practicing more with my PHP scripts. I picked up the long path strings from a friend of mine and never took the time to research a different way of doing it. It’s a pain when I transfer the test files from my LAMP server to my live DNS and have to change all the paths around accordingly.
Here’s an idea though that seemed to work. Try setting the file permissions right Scott, so that the server can GET to your PHP files. (DUH!) :\
If you have to use absolute paths, say because the included files are in a library, at least use a defined constant for the path so that it can be edited in one place.
include LIBRARY_PATH . “somelib.php”;
Remember to put a trailing slash in LIBRARY_PATH in this case.