403 Forbidden : You don't have permission to access - php

Forbidden
You don't have permission to access /install/step3.php on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Why is it showing this error when I'm trying to install a script?

Your question have 2 configuration problem.
File Permission (in Filesystem)
ErrorDocument Attribute (in Apache Webserver)
First, You can solve permission error using 'chmod' and 'chown' command.
try this:
chmod -R 777 directory (777 means allow permission for all)
chown -R [user]:[group] directory (generally, the same [user] and [group])
Second, ErrorDocument handle error can occured from invaild ErrorDocument attribute setting in .htacess or httpd.conf(or apache2.conf) file.
try this:
check your .htacess file in 'install/' directory. If you can not check this file, you can try 'ls -al' command in terminal. you have to find 'ErrorDocument' attribute, and remove or correct it.
check your apache webserver configuration file (httpd.conf or apache2.conf). If you can check 'ErrorDocument' attribute, you can try remove this attribute in file. It is temporary, so you must backup it before try suggested cases.
If you can not solve by case 1 and 2, you can try disable 'AllowOverride' attribute. Try find 'AllowOverride x' attribute and replace to 'AllowOverride None'. Because, this problem can have possiblity from .htacess file in parent directories. AllowOverride attribute can control allow or deny additional configuration in .htacess file.
You must restart apache service after try this cases. you can try 'service httpd restart' or 'service apache2 restart' command.
Good luck to your web server and you.

First thing to do is check that the index.html is written in properly. Forbidden 403 usually indicates that the server is running but that the requested resource is not being found.
Then clear your cache. Additionally check your php.ini file to configure any necessary items to get your website running.
The Web server (running the Web site) thinks that the HTTP data stream sent by the client (e.g. your Web browser or our CheckUpDown
robot) was correct, but access to the resource identified by the URL
is forbidden for some reason.
This indicates a fundamental access problem, which may be difficult to
resolve because the HTTP protocol allows the Web server to give this
response without providing any reason at all. So the 403 error is
equivalent to a blanket 'NO' by the Web server - with no further
discussion allowed.
By far the most common reason for this error is that directory
browsing is forbidden for the Web site. Most Web sites want you to
navigate using the URLs in the Web pages for that site. They do not
often allow you to browse the file directory structure of the site.
For example try the following URL (then hit the 'Back' button in your
browser to return to this page):
http://www.checkupdown.com/accounts/grpb/B1394343/
This URL should fail with a 403 error saying "Forbidden: You don't
have permission to access /accounts/grpb/B1394343/ on this server".
This is because our CheckUpDown Web site deliberately does not want
you to browse directories - you have to navigate from one specific Web
page to another using the hyperlinks in those Web pages. This is true
for most Web sites on the Internet - their Web server has "Allow
directory browsing" set OFF.

I have faced this problem. On local host it was running as I want, but when deployed (using Filezilla in my case) on the remote server, the problem occurred. with error 403 instead of 404. I think as mentioned before, It is a restricted access from the server. I only reuploaded the whole folder and every thing is perfect now.
Thanks to this community.

.htaccess
ErrorDocument 404 /index.php
ErrorDocument 403 /index.php
ErrorDocument 403.14 /index.php
ErrorDocument 500 /index.php

Related

403 Forbidden Error - iPage

I have an issue with my website, I linked it with Wordpress but there's a sub-menu where I get a 403 forbidden error.
This is the folder in iPage
And here's the Wordpress page I want to show up
I tried removing the .htmaccess file and refreshing the permalinks but it didn't work at all.
Any help?
Noo, Wordpress dont need any folders.
Wordpress works with the .htaccess
You can delete this folder and restart your server.
You don't have to add any directories or files after WP installation is finished, all WordPress functions will work via administration panel. But let me explain what is going on.
The 403 forbidden error you are getting is normal and expected webserver behavior in your case.
The webserver checks the request (the URL given) and tries to determine if it is a file or a directory. In your case it is a directory, which (by default) makes your webserver serve index.html or index.php file inside that directory.
However, if no such file exists, the webserver's next step is to list all items in a directory, which you don't want and is disabled in your case (and in most web server's by default for security reasons), thus webserver returning 403 forbidden error.
You can try to add a file named index.html inside your directory and see what happens, the 403 forbidden error will be gone and webserver serve your file.
If you want to serve your WordPress page instead of the actual directory you have on the server, you will have to remove or rename the directory on your server, or rename the permalink for the WordPress page.

Apache forbidden error. But the index page works well

Well I have been having a tough time trying to figure out the reason for getting the forbidden error message on my wamp server.
I have a folder website_ink inside c:/wamp/www/ folder. when I access
http://localhost/website_ink/
the index page loads fine. But when i try to access any other page it gives me a forbidden error message.
The url i tried accessing was http://localhost/website_ink/cloud-plans.
This page does exist inside my root directory meaning inside website-ink/cloud-plans.php page does exist.
This is the error I find when visiting the url on browser
Forbidden
You don't have permission to access /website_ink/C:/wamp/www//website_ink/cloud-plans.php on this server.
Apache/2.4.9 (Win32) PHP/5.5.12 Server at localhost Port 80
This is the error message i found in the log file
The given path is misformatted or contained invalid characters: [client 127.0.0.1:60811] AH00127: Cannot map GET /website_ink/cloud-plans HTTP/1.1 to file.
I do not have any virtual hosts setup or anything fancy. Also I tried upgrading from Apache 2.2 to Apache 2.4. Currently I am using Apache 2.4.
Please help
The reason why it happens is you try to open "/website_ink/cloud-plans" instead "/website_ink/cloud-plans.php".
In case you want to use path wiht out file extension you need add rewrite rule to .htaccess or httpd.conf:
RewriteEngine on
RewriteRule ^/(website_ink/.*)/$ /$1.php [L,QSA]
Also you need mod_rewrite to be installed and enabled

Magento new host - 403 Forbidden - Server unable to read htaccess file

I have moved to a new host and setup everything, but when I try to access the site, I get the following 403 Forbidden error
Forbidden
You don't have permission to access /webfiles on this server. Server
unable to read htaccess file, denying access to be safe
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Any ideas on the problem?
very easy just go to your main directori example
home/example
go to the directory public html and then go to you setting by the fault the system goes to 754 you will have to change to 755 the last 5 is go ing to allow to get to the site. cheers
I figured it out right after I posted. it was the file permission problem in the main root

Forbidden error in server not in local host for huge data

I have an application which allows users to share there notes.
The front end is written in php and back end is driven by mysql database. The front end has an edit section, which is using Ueditor (web based editor). The problem is that if I am trying to edit small amount of data on the server it will work, but if I am trying to edit huge amount of data it will not work and shows this error.
Forbidden
You don't have permission to access /editnotes.php on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Additionally it is working perfectly alright in local host.
The ErrorDocument directive, when supplied a local URL path, expects the path to be fully qualified from the DocumentRoot.
Have this in your .htaccess file
ErrorDocument 403 /errorpagedir/403page.html
/errorpagedir/403page.html is your 403 error page.

Returning Http Status Code to Apache from PHP?

On my local development machine, I downloaded PDT + Zend Server, which included Apache 2.2.16 and PHP 5.3.5, running on Windows 7. On my local site, I included a .htaccess that includes ErrorDocuments for 404, 403, and 500. In my PHP, I use header("Http/1.0 404 Not Found") when the user requests a document that doesn't exist. On my local server, everything works great. My custom ErrorDocument appears and I'm happy.
I upload the everything to my shared host running Apache 2.2.38 and PHP 5.3.8 on a Linux server, and suddenly the ErrorDocuments only work if they don't come from PHP.
Is there some setting in PHP.ini or httpd.conf or .htaccess that allows Apace to see the error codes from PHP, which makes my dev server work correctly, but not my shared host?
In researching this, all I ever saw was "Apache doesn't see the status code once it passes off to PHP." In such a case, why does my dev server work right?
Edit
For clarity, here's the .htaccess:
# Use PHP 5.3
Action application/x-hg-php53 /cgi-sys/php53
AddHandler application/x-hg-php53 .php
#Deny Include Files
<Files *.inc>
order deny,allow
deny from all
</files>
#Provide custom error documents
ErrorDocument 404 /Errors/Http404.php
ErrorDocument 403 /Errors/Http403.php
ErrorDocument 500 /Errors/Http500.php
The .htaccess works because if the user navigates to myhost.com/jdkslfjdls the user receives the content of Errors/Http404.php.
However, if the user navigates to myhost.com/images/GetImage.php?Id=5 (when there is no image #5) the user receives no content.
If they navigate to (Internal IP Address)/images/GetImage.php?Id=5, the user receives the content of Errors/Http404.php.
A similar problem occurs if the user tries to access GetImage.php?Id=6 (when there is an image #6 but they don't have permission). On the shared server, they get a blank page or the browser's 403 error. On my dev server, they get my actual custom 403 error page.
Again, 403 error document works on the shared server if I try to access a .inc file.
Are you sure that your .htaccess file is used on the server? Sometimes the hosting company does not allow the global apache settings to be overwritten by the local .htaccess files.
If you however have access to your virtualhost configuration than you may want to look at the following directive
AllowOverride All
If instead you find
AllowOverride None
try to change as above.
Check if you have
AllowOverride ALL
in your apache.conf under the Directory directive inside the VirtualHost corresponding to your website
Anyway, that may be one possible cause, the other may be to check whether or not you have enabled mod_rewrite
On ubuntu or debian based systems, you'd simply link or copy the mod_rewrite.load from /etc/apache2/mods-available/mod_rewrite.load to /etc/apache2/mods-enabled/mod_rewrite.load
Rewrite should have nothing to do though, but I've seen cases where your .htaccess directives may require mod_rewrite
So check for those things in apache conf files.
If nothing happens contact me # phpcip#gmail.com
Hope it works.

Categories