Hosted a new website. But when ever I open my website in the browser it is throwing the below error. Tried changing the .htaccess ReWriteRule but could not resolve it.
You don't have permission to access / on this server. Server unable to
read htaccess file, denying access to be safe Additionally, a 403
Forbidden error was encountered while trying to use an ErrorDocument
to handle the request.
This most likely means that apache doesn't have permission to read the directory where your .htaccess is located. Check the permissions on the folder where the file is located.
Ok, so I was facing this issue as well. Now keep in mind, the location of my application was a folder being shared with the Guest OS. Now what I had forgotten to do is to check, and make sure all permissions were enabled on said file on the HostOS.
So what I recommend is that you check the file permissions on the HostOS. Might be nothing you did, just something you forgot to do. Here is a screen shot of what I'm talking about.
Correct file permissions on left, zend skeleton displaying on right
I was unable to restart apache using my ID. So I restarted it using root user and hence this error. Later I changed access permission of httpd folder to 755 and restarted using my ID. The issue was resolved.
hello I think you have some problem with permission like it's was mentioned on your hosting you will find some number near your file like 755 those are the privilege of your file if there wasn't on that number 7 maybe 5 or 4 change it to 7 and like that your application could get the access and lunch your application
Related
I'm using Apache and PHP. Webroot directory is /home/name/public_html
I want to include a file from /home/name/abc.php
include_one "/home/name/abc.php";
I got failed to open stream: Permission denied warning.
If i move the same file inside the webroot /home/name/public_html/abc.php
There is no error.
Apache User and Group has the permission to access the file /home/name/abc.php
I have another server with the similar configuration, it is working. Just want to know the possible reason.
I tried to run the PHP script directly in linux console, there is no permission issue. I guess the problem is in Apache configuration.
You should verify that php is really executed as the apache user. Depending on your configuration it might be possible that php is running under a different user, e.g. if your Apache is set up to use php-fpm.
If the server is a linux system, putting this
<?php
echo "<pre>";
var_dump(posix_getpwuid());
into a file and accessing via the web browser should show you the user informations.
I found the way to solve this issue from here. I have SELinux running on my Centos 7 Virtual Server.
I need to grant httpd permission to read from /home dir using:
sudo setsebool httpd_read_user_content=1
So this is what's happening. I don't know how to explain this.
I made a software which uploads file to my website's FTP location. It's working as it should.
As you can see in the folder that inside public_html/phphostrot.rviews.xyz/user_rot/ there are 2 php files. But when i visit the url http://phphostrot.rviews.xyz/ i get a blank page with inder of / and nothing else. And if i try to access http://phphostrot.rviews.xyz/user_rot/ I get 404 error. Even the link to the file is not working. I don't know what's the problem.
I think it's a issue with the file permissions. Have you configured your server to serve files from your public directory.
Try changing the ownership of the files to www or apache
app, img, wp-admin, wp-content, wp-includes?
check file permissions (+x), as #atefth said, check owner.
check webserver config. and check apache/nginx logs
I am running a nginx server and php5, but I am not able to get mkdir in php working. I always get a permission denied error.
The user, who is running nginx is www in group www, the same applies for php and my folder where I want to create a new one is also hold by www.
It only works when I set the folder permissions to 777, with 775 I can't get it working.
The curious thing is, when I try to create a folder in the terminal as www user it works without any issues.
Any help would be really appreciated, because I have been struggling with this error for 2 days.
That's probably because problem with PHP module configuration. You have to set correct user there, too.
Check this documentation.
I see that similar questions have been answered on Stack Overflow, but the solutions haven't fixed my particular problem, so I have to ask...
I have an app that needs to make directories and modify files outside the site directory. This works find on the production server.
After spinning up a test server with the exact same version of Ubuntu and PHP, I'm getting errors on the staging server when it tries to open files or create directories.
Here are the errors:
mkdir() [http://php.net/function.mkdir]: Permission denied
fopen(/root/Dropbox/Backend/Booth-01/settings.sh) [http://php.net/function.fopen]: failed to open stream: Permission denied
Things I have tried:
checking the username running the application (it's www-data)
changing the owner of the external directory recursively to www-data
changing permissions on the directory to 777 (I know, this is a bad idea, but I was just trying it to see if that would help until I figured out what the issue was and will change the permissions to something more restrictive once I get it working)
checking the umask value. It was set to 0002, which shouldn't give me problems. Just for kicks, I tried changing it to 0000 and it didn't help.
checking to make sure PHP's safe mode wasn't enabled.
checking to make sure that nothing was specified in open_basedir. In any case, if that was the issue, it would throw a different error message.
I can't think of what to try next and I'm hoping that someone else is seeing something that I'm not.
Ubuntu 12.04.5 x64
PHP 5.3.10
It's not only the folder itself you have to have permissions on. You should also check the parent folders. I think, if you check this, this will fix your problem.
If this is an external drive (see if it shows up in mount) then you may have to remount it. An auto-mounted external drive can thwart permissions
sudo umount <moint-point>
sudo mount /dev/<device> <new-moint-point>
We moved our Magento installation from one FreeBSD VPS server to another (8.2 to 10.0). After that, we can't see anything in Magentos /var/log/system.log anymore.
We have checked and re checked the permission (777) on /var/log/*
Whe have tried to enable logging in /index.php
We have checked the database => dev/log/active = 1
Whe have tried to change owner of system.log and exception.log
Where afraid something might be missing in PHP, maybe som extension? Or could it be permission on the local servers /var/log directory?
How can we produce an error, that should be logged to Magentos /var/log ?
make sure you root magento directory is writable and make sure apache user has permission to write file
Did you try to delete the old logs?
We had that problem - just renamed file and everything went okay.