Hi, I have a problem with a PHP script. I've moved the script to another location and now I'm getting errors like: Warning: require_once(includes/common.php) [function.require-once]: failed to open stream: No such file or directory in .......... But the file is there. The php code I'm using to call the files is require_once "includes/common.php"; fopen() is not supported where script is now located. Is this why I'm getting this code error? Do you have any ideas how to fix it? Thank you.
try this require_once("/includes/common.php"); or require_once("./includes/common.php"); or require_once ("../includes/common.php"); or find the exact path e.g. /user/home/domain where is your includes folder is.
If you know the includes folder is in the same folder as the script you are running you can do something like this. $curpath = realpath('./'); require_once($curpath."/includes/common.php"); Code (markup):
This might caused by some lacking features in your PHP installation. Try uploading this to your root directory: <?php phpinfo(); ?> Code (markup): Then make sure that all functions you used in your PHP script are enabled by your hosting provider, for example if you are using fopen, try to look at the phpinfo information if that is enabled. Otherwise , you need to contact your hosting provider or do some upgrade. Do not forget to delete your phpinfo.php after troubleshooting because it poses security risk by being accessible to others.
could be ftp problem. using ascii mode not binary mode to upload. besides these, why not use include "includes/common.php"
Normally only a problem if the code was somehow encoded. Course ioncube now encodes in ascii mode by default (via the purchased encoder) so less likely to be that. But even if that were the case the error would not be saying file not found, but simply importing garbage data.
Sounds like a line break issue, kinda like downloading a Unix file onto a windows system without the FTP application automatically converting the line breaks (windows typically uses something like \r\n where as unix/linux is typically just \n) FTP applications generally running in ASCII or Auto transfer mode will typically try to convert the line breaks in known files types (Which breaks a php file with binary encoding). I never really noticed it since switching to a mac (which uses a linux style file system)
Normally doesn't make a difference, but can however be annoying to edit. Depending on the IDE you are using to edit you may even be able to change your encoding somewhere in the menu.