Php error on localhost. Error 403 - php

I am currently getting an error with php using XAMPP. The error is:
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
Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
I have no changes made to the config of XAMPP and was unable to find away to fix this. I have read about the error and tried suggested fixs, none of which work for me or others that tried them.
A bit more info on this, it only happens after clicking a submit button ().
Any suggestions on how to fix this would be very much appricated

PHP is probably not running. i once had this problem with apache2 php5 and apache-php5-mod(from my package repository) on linux.
I could only serve plain html(no php) files untill i fixed it.
Does a simple php_info() file work?
Is the page with the submit button a .php or a .html?
If the phpinfo file fails try making a simple php info and running it from the command line(without the apache server)
(to do this):
1. open windows explorer.
2. navigate to php.exe
3. in the address bar, enter "C:\WINDOWS\system32\cmd.exe" (a window should open.)
4. in the window type "php.exe PATH_TO_PHPINFO_FILE\FILENAME.php"
Please tell me what it outputs.

Related

Is there any fix for Xampp Object not found?

Today I tried to open xampp and run apache and MYSQL and they were working but any .php file I try to run It says the following:
Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
Apache/2.4.53 (Unix) OpenSSL/1.1.1n PHP/8.1.4 mod_perl/2.0.12 Perl/v5.34.1
I tried to check my files and check my database and they were fine.I Also tried to run it on a Windows Machine and it didn't work.Thanks in advance.
Oh I found it I just uninstalled xampp and deleted the remaining folders then installed it again and created the Database and the tables.And now it is working.Thanks for replies.

As I am using the local hosting of MAMP but " There has been a critical error on this website" this is error is coming. What should I do?

As I am using the local hosting of MAMPbut " There has been a critical error on this website" this is error is coming. What should I do?
Diagnostic steps worth giving a shot, follow from top to bottom order;
Is MAMP really running with Web server (and additionally the database server)?
Do you see the default MAMP index/home screen?
Put a simple HELLO WORLD HTML document to your project root and check if you can see it on browser
Put a simple HELLO WORLD PHP script to your project root and check if you can see it on browser
At this point, if everything above went well, it is definitely an issue with your actual PHP script, check the PHP error log file
Put an INFO.PHP PHP script at your project root and check you have all the required extensions available for your PHP project
Check if database connection is working (if required)
At this point, I cannot imagine what else would go wrong, try PHP debugger (xDebug needs to be installed with MAMP and your PHP editor may need a configuration for this) with break points and step into each line of your PHP code with debugger.

Object Not Found and other issues in XAMPP in OSX

I used to use installed Apache on my Mac to run php-files, but after updating to High Sierra my PHP already updated from v5 to v7. I've tried lots of hints but nothing worked. I've stopped the Apache server and installed XAMPP. It worked for the first time, but when I tried again for the second time it gave me 'Permission denied' error.
Then I've fixed it with httpd.conf and other manipulations. Now, when I click 'Go to application' it gives me this:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
I checked and there are all necessary files (index.php, 2.php[my test]) in opt/lampp/htdocs, but this problem remained? Would be very grateful for any help!

Running PHP in IIS6

i am using IIS to run my php website and i configure IIS to work with php as its explained the following tutorial
http://www.wikihow.com/Install-PHP-5-for-IIS-6
but when i run any php page is give me the following error
You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed.
i follow this https://serverfault.com/questions/251499/error-when-installing-php5-on-iis6/252149#252149
now i am getting the following error message
FastCGI Error
The FastCGI Handler was unable to process the request.
Error Details:
Could not find entry for "php" on site 67761686 in [Types] section.
Error Number: 1413 (0x80070585).
Error Description: Invalid index.
HTTP Error 500 - Server Error.
Internet Information Services (IIS)
here is my updated fcgiext.ini
[Types]
php=PHP
[PHP]
ExePath=C:\PHP\php-cgi.exe
now i am getting this error message
The FastCGI Handler was unable to process the request.
--------------------------------------------------------------------------------
Error Details:
The FastCGI process exceeded configured request timeout
Error Number: 258 (0x80070102).
Error Description: The wait operation timed out.
I hope this link would help
http://www.ardamis.com/2009/02/15/php-pages-return-a-404-error-on-iis/
Open iis.msc again, go back to the Home Directory tab, and select the “Scripts only” option >from the Execute Permissions menu. Restart the server.
The server should now be correctly processing .php files.
PHP pages return a 404 error on IIS
I was installing PHP 5 on an IIS 6 server when I ran into what turns out to be a pretty common problem. PHP appeared to be installed correctly, but browsing to any page with a .php extension returned a 404 Page Not Found error. While the steps below fixed this for me, I had to piece them together from a few different sources, and a number of other suggestions (like copying the php.ini file to C:/WINDOWS/) didn’t work and were not necessary.
Open your IIS management console at C:\WINDOWS\system32\inetsrv\iis.msc.
Drill down to your web site, right-click and select Properties.
Select the Home Directory tab, then click on the Configuration button.
Select the Mappings tab.
If you don’t see a .php extension listed, click the Add button. Browse to the PHP 5 DLL (which may be at C:\Program Files\PHP\php5isapi.dll). Type .php into the Extension field and leave everything else at the default values. Click OK. The extension and executable path will be filled out and under Verbs you should see “All”.
I should point out that I didn’t have anything listed under the ISAPI Filters tab.
Stop and restart your IIS server and browse to a .php file. (To restart your IIS server, open the IIS management console, right-click the local computer in the left pane, hover on All Tasks and choose Restart IIS.) Chances are, you’re no longer getting the 404 error, but are now seeing a 403.1 message, like:
The page cannot be displayed
You have attempted to execute a CGI, ISAPI, or other executable program from a directory that does not allow programs to be executed.
Please try the following:
* Contact the Web site administrator if you believe this directory should allow execute access.
HTTP Error 403.1 – Forbidden: Execute access is denied.
Internet Information Services (IIS)
Open iis.msc again, go back to the Home Directory tab, and select the “Scripts only” option from the Execute Permissions menu. Restart the server.
The server should now be correctly processing .php files.
Take a look at my answer on Server Fault for a fairly bulletproof way to install PHP in under ten minutes:
Error When Installing PHP5 on IIS6
If you follow all of the steps in the correct order you'll have PHP up and running in no time.
Updated:
As per your comment and question update, edit your fcgiext.ini file so that it only contains the following lines:
[Types]
php=PHP
[PHP]
ExePath=C:\PHP\php-cgi.exe
Execute the following from the command prompt:
1.
cd c:\Windows\system32\inetsrv
2.
c:\Windows\system32\inetsrv>cscript fcgiconfig.js -add -section:"PHP" -extension:php -path:"c:\php\php-cgi.exe"

How to Debug php in Eclipse

I am new to PHP.....
(In Eclips IDE) If i run the PHP code with Run As --> "PHP Script", that will work fine but Run As --> "PHP Web Page" is throwing the error as
Object not found!
The requested URL was not found on this server.
If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
03/22/11 12:04:12
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11
OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8
Please help me....
Gnanendra
If you are using XAMPP place your eclipse project workspace in the XAMPP\htdocs\ folder. if you use WAMP then place it in the WAMP\www\ folder. you'll find the XAMPP or WAMP folders in the directory where you have installed it.
for your reference:
Are you using any XAMPP or WAMP service? Did you place your files properly? It says the apache could not find your file. i.e. you've either not configured your environment properly or your file is at a wrong place.

Categories