Back again

by Michael Alderete on 9/21/2004

Back on the air. I’ve been in the process of switching from my old QuickSilver G4 desktop to the new PowerBook, and when I took the old computer offline, I locked myself out of this blog. I actually run the editing client on my personal computer, but have a read-only version on the FreeBSD server that actually makes it public. So, when I took down the old computer, the site was still online, but not editable.

Getting the editing client running again was a fair amount of trouble. First there were all the code files to move over and into the right place. Then there was configuring Apache and PHP correctly. Then I needed to allow access to the database server from the new machine.

And then I got stuck. On the same problem that stuck me three years ago when I moved onto the QuickSilver: I could not include() in the code files for the blog. Or any files, for that matter.

Finally tracked down the problem, a teensy little thing, that I’m sure I’ll forget again by the time another three years goes by, and it’s time for the next new computer.

So, in the hopes that Google will find the answer when I try looking for it again:

Problem: For some reason, even though your PHP include_path does contain the location of your include file, PHP cannot seem to actually include() the file. The paths match exactly, and yet you still get errors.

Symptom: Trying to include() PHP code files into a main file results in errors like this:

Warning: main(include-file.inc): failed to open stream: No such file or directory in /path/to/main/file on line 18
Warning: main(): Failed opening ‘include-file.inc’ for inclusion (include_path=’.:/Users/username/Library/WebServer/…:/Library/WebServer/…’) in /Users/username/Sites/blog on line 18

Answer: You are keeping the include files in a location inside your own home directory (~/Library/… here). The permissons on ~/Library are no access for group and world. So the web server process cannot access them — even though the actual include directory has correct permissions.

Resolution: chmod go+rx ~/Library

{ Comments on this entry are closed }