innercproductions
asked on
PHP - file_exists problem
I'm having trouble with this PHP code.
The file DOES exist, but it's giving me the other result.
if(!file_exists($file))
{
echo "Does not exist";
}
else
{
echo "Yes! Exists!";
}
I need help. Why is it working backwards?
Are there any other options?
The file DOES exist, but it's giving me the other result.
if(!file_exists($file))
{
echo "Does not exist";
}
else
{
echo "Yes! Exists!";
}
I need help. Why is it working backwards?
Are there any other options?
The web server needs read access to the file and the folder that contains it I believe. Try checking that.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
please post an example for $file
ASKER
I think it's working now. But I'm not sure what I changed.
Question: what does the PHP safe mode do? In simple terms... short description. AND... is it really needed?
Question: what does the PHP safe mode do? In simple terms... short description. AND... is it really needed?
Note in the PHP manual (http://jp.php.net/manual/en/features.safe-mode.php):
"Safe Mode was removed in PHP 6.0.0"
Quote from: http://www.webhostgear.com/319.html
Safe mode is an easy way to lock down the security and functions you can use. PHP.net explains php safe_mode as, "The PHP safe mode is an attempt to solve the shared-server security problem. It is architecturally incorrect to try to solve this problem at the PHP level, but since the alternatives at the web server and OS levels aren't very realistic, many people, especially ISP's, use safe mode for now."
I highly recommend you enable safe_mode on production servers, especially in shared environments. This will stop exec functions and others that can easily prevent a security breach.
"Safe Mode was removed in PHP 6.0.0"
Quote from: http://www.webhostgear.com/319.html
Safe mode is an easy way to lock down the security and functions you can use. PHP.net explains php safe_mode as, "The PHP safe mode is an attempt to solve the shared-server security problem. It is architecturally incorrect to try to solve this problem at the PHP level, but since the alternatives at the web server and OS levels aren't very realistic, many people, especially ISP's, use safe mode for now."
I highly recommend you enable safe_mode on production servers, especially in shared environments. This will stop exec functions and others that can easily prevent a security breach.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the info.
Anyone want to suggest how to divide/give points?
Anyone want to suggest how to divide/give points?
Do you think your solution had anything to do with taking PHP out of safe mode? If so, then please pick my solution as the primary one (250) and offer assists (125 ea) to Terry and hoffman. If not, then just divide the points evenly between Terry and hoffman, because you asked a new question which they answered and I did not participate in.
That's my advice anyway. If you're primary question was never answered and your secondary was, then it seems fair to divide the points between those who answered the secondary question.
That's my advice anyway. If you're primary question was never answered and your secondary was, then it seems fair to divide the points between those who answered the secondary question.
ASKER
Since none of you hit the nail on the head (probably because I didn't know exactly what to ask)... but all of you did help me with info and somehow probably led me to the solution... I will divide points evenly.
I turned SafeMode back on and restarted the webserver... nothing changed. It still works.
So I don't think that was it MasonWolf. But i did consider your suggestion. Thanks.
I turned SafeMode back on and restarted the webserver... nothing changed. It still works.
So I don't think that was it MasonWolf. But i did consider your suggestion. Thanks.