I am trying to get WordPress running on AWS, and I keep getting the following error.
403 - Forbidden:
You don't have permission to access / on this server.
I have installed PHP on the server, used Filezilla to add the files to AWS, and have gotten Apache to reference the proper location.
In terminal, I am getting this issue:
[Mon May 04 17:39:59.709131 2015] [authz_core:error] [pid 9239] [client 000.000.000.00:2935] AH01630: client denied by server configuration: /home/ubuntu/www/
I realize there are a lot of problems this could be caused by, but I'm wondering what it could potentially be because I have exhausted the options I am aware of.
I was getting a similar issue on a Beanstalk Wordpress. Following the AWS tutorial it would appear that your site would be accessible through the Elastic Beanstalk URL, but you had to add the full path [your Elastic Beanstalk URL]/wordpress-elasticbeanstalk.
Wordpress was accessible there. So maybe playing with copying your files to other location and trying to access that location.
Related
I've installed php, mysql, apache with WAMP for windows 10. When I go to http://localhost there is not any problem, the appropriate page is shown. The server is up and running, but when I try to open http://localhost/test.php it gives me 404 not found error. By the way I've put the index.html and test.php into wamp64/bin/apache/apache2.4.46/htdocs. The server can access neither index.html in that directory nor test.php. Your help is welcome.
Like #Selim Achour said I looked to the error logs and I found that apache server wasp/ searching the test.php in a folder called wamp/www/test.php. When I move the test.php from htdocs/test.php to www/test.php it works perfectly. I was following instructions from a book that I'd been reading. In that book's instructions, it is clearly stated that you should move test.php into htdocs. That was what got me confused. Thank you all for your effort.
The error: Sat Sep 26 13:14:03.134587 2020] [php7:error] [pid 8220:tid 1204] [client ::1:6466] script 'C:/wamp64/www/test.php' not found or unable to stat
WAMPServer's DocumentRoot folder is C:\wamp64\www BUT You should NEVER place your scripts into that folder!!!
Make a subfolder and use that i.e. C:\wamp\www\test1 put your test.php in there and run using locahost/test1/test.php
Better still create a Virtual Host for all your test areas and development site folders. See THE NEED for VIRTUAL HOSTS and then WAMPServer 3 Create a Virtual Host, the easy way
Recently, I moved a website to live and all the file related operations stopped working, for e.g., copy, imagecreatefromjpeg, etc due to permissions issue.
All the files are created in files/ directory. I gave it 755 permission recursively for directories and 644 permission to all the files. Still the PHP functions didn't work. It works only if I give 777 permissions (not even 775 works).
I checked the permissions for other live projects. They had 755 for directories and 644 for files, and still they seem to work fine without any permission issues.
Could anyone please explain me the reason for this issue on this specific website?
Thanks
It sounds like an ownership issue.
To test, create a folder on the server with 777 perms (e.g. tmp, perhaps in your document root).
And then create a script (alongside tmp) that does a simple write to that folder.
<?php
file_put_contents(__DIR__ . '/tmp/test.txt', 'hello earth');
Then look at the ownership and permissions of the resultant file.
On my dev server I have Php running under the web server Apache (using mod php) on Linux (Debian). And scripts run as the user 'www-data'. So the key here is that the user www-data needs to be able to write to the folder.
If the folder isn't writable by the web server, then something like the following error is in the apache error logs:
[Tue May 10 08:27:52.404959 2016] [:error] [pid 18] [client 172.17.42.1:59832] PHP Warning: file_put_contents(/var/www/stackoverflow/tmp/test.txt): failed to open stream: Permission denied in /var/www/stackoverflow/so_test.php on line 3, referer: http://localhost/
Try and understand your server environments and unix permissions.
On Fedora 20 I created a folder named test then installed Laravel via composer create-project laravel/laravel into it. It ran successfully and now I try to view it in FireFox in the following URL:
http://localhost/~username/test/laravel/public/
But it throws the following error:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at root#localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
If I go to the parent folder, I can see that everything is there except the public folder. However if I ls in the terminal I can see that the folder is right over there. There is no problem with other PHP scripts only with this project. I tried to play with folder permission but no success. Why can't I see the folder in the browser and why does it throws an Error 500 when I try to access it?
Debugging
After I looked at /var/log/httpd/error_log I saw the following in the last line:
[Tue May 20 09:37:21.874443 2014] [core:alert] [pid 2897] [client ::1:55498]
/home/username/public_html/test/laravel/public/.htaccess:
Options not allowed here, referer: http://localhost/~username/test/
Make things work
So in my public folder I renamed the .htaccess file to .htaccess2 and now it works. Of course now I need to write index.php after public/ in the URL but at least it works. This also solved the invisible folder error, so if I go to the project root (the parent folder of public) in the browser it lists the public folder too.
Try to fix it
According to this answer configurations in the httpd.conf file can be overwritten by other extra files. You should search these files for a line containing AllowOverride like AllowOverride AuthConfig FileInfo and replace it with AllowOverride All.
I am trying to add an extension to my PHP. I have the file - libssh2.dll - in the appropriate directory (as listed in my php.ini file) and made sure the extension=libssh2.dll. I also copied the .dll file to system and system32 folders as other threads have suggested. When I try to start my Apache server I get the following windows error:
Apache HTTP Server has encountered a problem and needs to close. We are sorry for the inconvenience.
and Apache Monitor error:
The requested operation has failed!
I check the log to see this:
[Tue Jul 26 16:43:06 2011] [warn] pid file C:/Program Files/Apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
I have tried to go in this direction but am completely stumped at this point. Hoping someone out there can help me and so I can figure out what's wrong. Thanks in advance guys!
Cheers
I think that it is telling you that you need to remove just the previous pid file. Each time that you run apache a http.pid file is created in apache's bin folder. It contains the apache pid.
I solved it by upgrading to 5.3. Somehow with the same settings it automagically worked. Closing the issue now.
I'm building a website. For some reason when I try to run it on the local host, I get this message:
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Sat Nov 20 22:19:02 2010
Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1
What should I do to fix this so my website shows up on the local host. The website is coded in html/css/php. Thank you.
Look at the error logs.
I would agree with trying to read the apache log file for the specific error.
Sometimes, though, a 403 Forbidden error can be a simple permission error. Make sure the web directories are 755 and files are (atleast) 644 (but don't go chmod'ing everything to 777!)
For example,
chmod 755 /path/to/you/web/root
echo 'testing.. hello world!' > /path/to/you/web/root/test.php
chmod 644 /path/to/you/web/root/test.php
Hopefully that will get you going. If not, check your apache settings file (usually httpd.conf) and check out any mentioning of you web root. A 403 error can also be caused by apache trying to serve up a directory outside of it's WEBROOT.. meaning the webserver doesn't actually have access to the files.
Good luck.