Php localhost 404 error

How to Fix the XAMPP HTTP Error 404 “The Requested Resource Is Not Found”

When it comes to developing WordPress in a local environment, XAMPP is a popular and trusted tool. However, that doesn’t mean you won’t ever run into errors. One you might come across is the HTTP error 404 “The requested resource is not found.”

If you encounter this issue, there are several ways to try to resolve it. These fixes aren’t overly complicated and don’t take a lot of time to perform. With a little patience, you should be back up and running in no time. In this article, we’ll explain what the error “requested resource is not found” in XAMPP is. Then, we’ll share five tips for how to fix the problem and get you back on track.

What the XAMPP HTTP Error 404 “The Requested Resource Is Not Found” Means

A 404 error is one of many HTTP status codes that are sent from a server to a client. In general, this error indicates that the browser is requesting something that can’t be found on the server.

An HTTP 404 error.

It can be challenging to determine the source of a 404 error, as there are several potential causes. These can include:

  • The domain no longer exists.
  • The requested resource has been deleted or moved to a different URL.
  • The URL was mistyped into the browser.

You’ve likely run into these situations when browsing the web. However, you can encounter 404 errors when working on localhost with XAMPP as well. In this case, you may also see the message expressed as Error 404 “the object is not found.”

Looking for a powerful tool for local WordPress development? DevKinsta features one-click site creation, built-in HTTPS, powerful email and database management tools, and more. Learn more about DevKinsta!

How to Fix the HTTP Error 404 “The Requested Resource Is Not Found” in XAMPP (5 Tips)

Now that you understand what this particular XAMPP error is, let’s explore how to fix it using the following five tips.

1. Be Sure You Typed the URL Correctly

Before you attempt any other fixes, we recommend double-checking that you haven’t mistyped or included anything unnecessary in the URL. For example, a common mistake is including “XAMPP” when it’s not needed:

An example of mistyped localhost URL.

Errant keystrokes are a frequent cause of this error but are also easy to fix. If you’re sure you’ve entered the correct URL and are still having problems, there are a few other solutions you can try.

2. Check Your .htaccess File

A missing .htaccess file can also cause a 404 error. Therefore, it’s important to be sure the file exists in the correct location, especially if you see the “the object is not found” version of the error.

To find the file, you can navigate to the XAMPP folder on your computer. Within this folder, there will be another one called htdocs. This folder is likely where you installed WordPress when you initially set up your website. You should find the .htaccess file there:

The location of the .htaccess file.

If you are using a macOS, the file will still be in the htdocs folder. However, you’ll find it via Applications > Xampp > xamppfiles > htdocs.

Читайте также:  Emulator error in android studio

If the file doesn’t exist, you’ll need to create one. To do this, open your preferred text editor and name the file “.htaccess”. The exact code you need to paste into it may vary depending on your setup, but it should look something like this:

Save the file to the folder you created for your website. Even if you don’t discover an obvious problem with your .htaccess file, sometimes simply replacing it with a fresh one can fix the error.

3. Deactivate and Uninstall New Plugins

When you install plugins, they may make changes to your code or database that can cause this 404 error. Starting with your newer plugins, you can try deactivating or uninstalling them to see if that fixes the problem.

Plugins can be deactivated from the admin dashboard of your local site. To do so, in the menu on the left of the screen, click on Plugins > Installed Plugins. To deactivate one, click on the Deactivate link under the name of the plugin:

Deactivating a WordPress plugin.

If you want to uninstall a plugin completely, you can do so from the same screen. First, deactivate the plugin, then click on the red Delete link that below the name of the plugin:

Deploy your application to Kinsta — Start with a $20 Credit now.

Run your Node.js, Python, Go, PHP, Ruby, Java, and Scala apps, (or almost anything else if you use your own custom Dockerfiles), in three, easy steps!

The option to delete a plugin after you’ve deactivated it.

Even if you haven’t installed any plugins recently, this is worth trying, since updates to plugins can sometimes cause problems. You can also deactivate all of your plugins at once by renaming the plugins folder in your site’s directory.

4. Check Your Database for Changes

Even if you uninstall a problematic plugin, the changes it made to your site may continue to cause issues. If you suspect this is the case, you may want to check your local site’s database for changes.

To access the database, you can type http://localhost/phpmyadmin into your browser. Alternatively, from the XAMPP control panel, you can click on the Admin button next to MySQL to open phpMyAdmin.

You can open phpMyAdmin from the XAMPP control panel.

Now you can click on the Databases tab at the top of the screen. Locate your website’s database in the list to view the tables it contains:

The default WordPress database tables.

Next, you’ll want to comb through the database and look for anything that shouldn’t be there. Some plugins will add entirely new tables to your database. To remove an unnecessary table, click on the Drop link to its right:

Removing tables from a WordPress database.

Most plugins will make changes to the wp_options table, so you’ll want to have a look at that entry. You can also check the core WordPress tables. While plugins shouldn’t change these tables, it is possible, especially if you installed a nulled plugin.

If you’re unsure what your database or tables are supposed to look like, you may want to create a new WordPress site. Then you can compare the fresh database to yours.

Looking for high-performance WordPress hosting powered by Google Cloud Platform’s fastest servers? Check out our plans.

Читайте также:  Fatal error class content

5. Check Your Apache Configuration

If you’re having trouble opening a PHP file, your Apache configuration could be incorrect. More specifically, there may be a conflict with the port that Apache is trying to use.

Apache uses port 80 by default, but you may need to change it if you already have something listening on that port. To find a free port, you can click on the Netstat button in the XAMPP control panel:

A list of ports in Netstat.

If port 80 is already in use, or if you just prefer to leave it open, you can go ahead and choose a free port number. We’ll use “8080” for this example, but you can use whichever port you’d like.

Next, you’ll need to edit the httpd.conf file. You can find it in C:\xampp\apache\config if you’re using Windows:

The httpd file location in Windows.

If you’re working on macOS, you can find this file in the /etc/apache2 directory. You can locate it using the Go to Folder option in Finder.

Once you’ve found the file, go ahead and open it in your preferred text editor. There are two lines you’ll need to edit:

Change the Listen port number to 8080 and the ServerName to localhost:8080 . Now you can save and close the file.

At this point, you can restart the Apache server and attempt to access localhost:8080 (or whichever port you’re using) in your browser. If you’re not successful, you’ll need to edit the http-ssl.conf file. Windows users can find this file in xampp\apache\conf\extra.

The httpd-ssl file location in Windows.

Once again, you should be able to locate this file on a macOS by typing /etc/apache2 into Finder’s Go to Folder.

Once located, you can open the file in a text editor. There are three lines that you’ll need to update in this file:

Locate each of these lines in the file and change the values to “8080”. After saving the file, you can restart the Apache server again. Now you should be able to access localhost:8080 in your browser.


The “requested resource is not found” error can undoubtedly slow you down when you’re working with XAMPP. There are a few possible causes for this issue. Fortunately, the solutions for resolving it aren’t complicated.

In this post, we covered a few ways you can attempt to fix the XAMPP Error 404. You can start by ensuring that you’ve entered the URL correctly, and move on from there. With any luck, you’ll be back to work in no time.

If you enjoyed this tutorial, then you’ll love our support. All Kinsta’s hosting plans include 24/7 support from our veteran WordPress developers and engineers. Check out our plans today to learn more!

Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:

  • Easy setup and management in the MyKinsta dashboard
  • 24/7 expert support
  • The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability
  • An enterprise-level Cloudflare integration for speed and security
  • Global audience reach with up to 35 data centers and 275+ PoPs worldwide
Читайте также:  To many rows oracle exception

Test it yourself with $20 off your first month of Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.


Запускаю phpMyAdmin — Пишет ошибку 404. (Хотя вроде все сделал)

Форум PHP-MyAdmin.RU → Установка phpMyAdmin → Запускаю phpMyAdmin — Пишет ошибку 404. (Хотя вроде все сделал)

Чтобы отправить ответ, вы должны войти или зарегистрироваться

Сообщения 3

1 Тема от Sperantos 2010-02-12 00:08:08

  • Sperantos
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2010-02-11
  • Сообщений: 2

Тема: Запускаю phpMyAdmin — Пишет ошибку 404. (Хотя вроде все сделал)

Запускаю phpMyAdmin — Пишет ошибку 404. Люди помогите, вроде все по инструкции сделал.

Not Found

The requested URL /phpmyadmin was not found on this server.

Apache/2.2.14 (Win32) PHP/5.2.12 Server at localhost Port 80

2 Ответ от Hanut 2010-02-12 12:58:29

  • Hanut
  • Модератор
  • Неактивен
  • Откуда: Рига, Латвия
  • Зарегистрирован: 2006-07-02
  • Сообщений: 9,722

Re: Запускаю phpMyAdmin — Пишет ошибку 404. (Хотя вроде все сделал)

В error.log хоста посмотрите где сервер ищет данный каталог.

Попробуйте ввести в браузере:

3 Ответ от chiffa 2010-02-16 21:20:42

  • chiffa
  • Редкий гость
  • Неактивен
  • Зарегистрирован: 2009-03-25
  • Сообщений: 7

Re: Запускаю phpMyAdmin — Пишет ошибку 404. (Хотя вроде все сделал)

да у меня такая же проблема была
Благодаря совету Hanut сделала. Зашла в лог ошибок там посмотрела на что ссылается, оказалось что надо просто имя папки поменять

Сообщения 3

Чтобы отправить ответ, вы должны войти или зарегистрироваться

Форум PHP-MyAdmin.RU → Установка phpMyAdmin → Запускаю phpMyAdmin — Пишет ошибку 404. (Хотя вроде все сделал)

Форум работает на PunBB , при поддержке Informer Technologies, Inc

Currently installed 7 official extensions . Copyright © 2003–2009 PunBB.


Вместо выполнения php, ошибка 404 / nginx

Имеется следующее:
archlinux, nginx 1.4.6, php-fpm. Настраивал по данному мануалу.

вместо выполнение php скриптов, выдает ошибку 404.

ЧЯНДТ? Помогите, пожалуйста.

Вот тебе мануал раз, два, а это то что у меня получилось, а вообще я специально темы создавал чтобы разобраться

]$ . as always want ready-made solutions that would make even tastier

Вот тебе мануал раз, два, а это то что у меня получилось, а вообще я специально темы создавал чтобы разобраться

но теперь вместо 404, скачивает файл

]$ . as always want ready-made solutions that would make even tastier

но теперь вместо 404, скачивает файл

у меня так было вот решение, читать после фразы На запрос:

Играя с конфигами получил 3 варианта развития событий:

]$ . as always want ready-made solutions that would make even tastier

Не знаю как nginx, а вот с апачем я поимел нехилый shit после недавнего обновления — конфиги поменялись, много что в них упразднили выкинули, пришлось конфиги с нуля настраивать, со старыми апач не стартовал, стартовал только с .pacnew все файлы из /etc/nginx

/etc/nginx/sites-enabled содержит ссылки на конфиги хостов из /etc/nginx/sites-available

Модуль rewrite не используется, так как не нужен на самом деле при правильном использовании HTTP
Для примера, этот конфиг работает с фреймворком Phalcon.

Я переустановил nginx php php-fpm, вставил Ваши конфиги, получаю ошибку 502 Bad Gateway.

не нужно бездумно жонглировать конфигами, плюс не забывайте о правах.

п.с. когда я создавал темы на форуме, я тоже хотел получить готовое решение сразу, так не получиться.

]$ . as always want ready-made solutions that would make even tastier


Оцените статью