Jump to content
snehu

php code can not read file from /var/tmp folder which is not created by apache

Recommended Posts

I am using apache web server on linux. I am using php for coding. My php code is not able to read the files from /var/tmp folder. If apache itself creates some files in /var/tmp folder then php code is able to read it. Why this permission denied issues are there though full access permissions are given to each file?

Share this post


Link to post
Share on other sites

What are the permissions on the files in question?

Share this post


Link to post
Share on other sites

I have given 777 permissions and also tried by changing the owner to apache by chown apache filename. In error logs it shows: failed to open stream. Permission Denied.

Share this post


Link to post
Share on other sites

 

Why this permission denied issues are there though full access permissions are given to each file?

 

it could be possible if the directory or the previous directory when the file is deployed has a 0 permissions to others. So, we need to see the output of:

 

ls -la /var/tmp/the_name_of_the_file

Edited by jazzman1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.