rubing Posted September 5, 2008 Share Posted September 5, 2008 I have a php script running in a public directory: /home/ted/public_html/myphpsript.php This script requires a php script located in a private directory require_once '/home/ted/lib/merge_mp3.inc'; running myphpscript.php I am getting the following error: Warning: fopen(./played/CaddleWORK2.mp3) [function.fopen]: failed to open stream: No such file or directory in /home/rubing/lib/merge_mp3.inc on line 481 The script being required (the one in my private directroy) is trying to save the file to it's own directory. But my document root is set to /home/ted/public_html??? Quote Link to comment Share on other sites More sharing options...
rarebit Posted September 5, 2008 Share Posted September 5, 2008 try it relative, (but your right there is a way) e.g. require_once '../lib/merge_mp3.inc'; Quote Link to comment Share on other sites More sharing options...
rubing Posted September 5, 2008 Author Share Posted September 5, 2008 yes, it works fine if i define it relative. but I am going to be moving these scripts and so need to define the paths absolutely? Quote Link to comment Share on other sites More sharing options...
rarebit Posted September 5, 2008 Share Posted September 5, 2008 read this. Quote Link to comment Share on other sites More sharing options...
rubing Posted September 5, 2008 Author Share Posted September 5, 2008 interesting read...but not much on my problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.