Weird php error

software development

#1

Because I publish my site with Movable type I have a lot of almost identical code on my site – I’m getting the following error with assorted paths at various spots on my site.

Warning: open_basedir restriction in effect. File is in wrong directory in /home/.drizzle/crysc/ed.fanworks.net/fiction/yugioh/one_or_two_for_the_road/summary.inc on line 8

This only shows up in cases where the file it’s looking for in line 8 doesn’t exist – but the code checks for that…

(note that the two blank lines after the ----- are really there in the file making #8 the one that starts with if)

<?php $updatedate = ''; $postdate = 'March 9, 2003'; if (file_exists ("/home/crysc/ed.fanworks.net/fiction/yugioh/one_or_two_for_the_road/stats.inc") ) { include("/home/crysc/ed.fanworks.net/fiction/yugioh/one_or_two_for_the_road/stats.inc"); } $wordcount += 3843; $reviews += 1; $pairings = "Yami Yugi/Pegasus, Yami Yugi/Yugi/Pegasus"; ?>

(continues but is irrelivent)

I haven’t changed anything… and I’d swear it wasn’t doing that a few days ago… Help?

(to see the error on a live page:
http://enlighteneddreams.fanworks.net/fiction/fulllist.phtml
)


#2

Adding the mountpoint into the path in the if statment worked, however it means my site gets screwed up everytime that changes :frowning: think it’s prolly time to talk to suport…


#3

I’m having the same problem with one of my scripts. Did you ever find a fix for this error?

-Tim


#4

I had to change to php as cgi (you can rename the script to .pcgi or change to processing all your scripts as php-cgi see:
https://panel.dreamhost.com/kbase/index.cgi?area=2526
)


#5

i’m reviving this thread, because i’ve just run into this same problem. if you use realpath() around your filenames, the open_basedir errors go away.

e.g.,

if(file_exists(realpath(“filename.ext”)))