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??? Link to comment https://forums.phpfreaks.com/topic/122805-fopen-saving-in-wrong-directory/ 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'; Link to comment https://forums.phpfreaks.com/topic/122805-fopen-saving-in-wrong-directory/#findComment-634153 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? Link to comment https://forums.phpfreaks.com/topic/122805-fopen-saving-in-wrong-directory/#findComment-634173 Share on other sites More sharing options...
rarebit Posted September 5, 2008 Share Posted September 5, 2008 read this. Link to comment https://forums.phpfreaks.com/topic/122805-fopen-saving-in-wrong-directory/#findComment-634217 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. Link to comment https://forums.phpfreaks.com/topic/122805-fopen-saving-in-wrong-directory/#findComment-634233 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.