I am using XAMPP. and internal server of Django.
When I browse to localhost
or 127.0.0.1
, It shows
Not Found . HTTP Error 404. The requested resource is not found.
It sometimes works fine and other times pops up the error.
Moreover, when I browse to my project url, ie 127.0.0.1:8000/cc
, the project url works fine.
Any ideas why is this happening?
asked Jul 23, 2013 at 7:21
PythonEnthusiastPythonEnthusiast
16.3k43 gold badges132 silver badges256 bronze badges
You need to add the port number to every address you type in your browser when you have changed the default port from port 80.
For example: localhost:8000/cc .
A little edition here is that it should be 8080 in place of 8000.
For example —
http://localhost:8080/phpmyadmin/
answered Jul 23, 2013 at 16:59
1
I had the same problem and here is how it worked for me :
1) Open XAMPP control panel.
2)On the right top corner go to config > Service and Port setting
and change the port (I did 81 from 80).
3)Open config in Apache just right(next) to Apache admin Option and click on that and select first one (httpd.conf) it will open in the notepad.
4) There you find port listen 80 and replace it with 81 in all place and save the file.
5) Now restart Apache and MYSql
6) Now type following in Browser :
http://localhost:81/phpmyadmin/
I hope this works.
answered Dec 11, 2019 at 10:57
Many frameworks like Laravel
, Django
,… run local web server that work on another port except 80.For example port 8000
is the most commen port that these local web servers use.
So when you run web servers that frameworks build them and type localhost:8000
it works well.But web server that xampp(apache)
runs it has another port.In default it has 80
that it does not need to type it in url.And if you change port you should mention it in url.
**In brief:**web server in framework is different from web server in xampp . Check the port of each server and mention it in url when you use them.
answered Feb 14, 2020 at 17:21
akbarakbar
5795 silver badges12 bronze badges
If your server is still listening on port 80, check the permission on the DocumentRoot folder and if DirectoryIndex file existed.
answered Dec 26, 2014 at 8:42
KlausKlaus
4415 silver badges8 bronze badges
Try checking your web routes most likely there is nothing pointing to the default path in your routes //default path or route Route::get('/', [ PagesController::class,'index']);
in this case
answered Mar 2, 2021 at 11:58
If you are getting a 404 Error in PHP or you are not able to see PHPMyAdmin,
it might be you have changed your default port.
For instance, I have changed from port 80 to 8081. So after changing the port, you have to just type http://localhost:8081 in your browser.
eg: localhost:yourPortName/
phpmyadmin Page — http://localhost:8081/phpmyadmin/
answered Mar 14, 2022 at 5:15
- Open XAMPP control panel.
2)On the right top corner go to config > Service and Port setting and change the port. Under the Apache tab , change main port to 8080 and SSL port to 4433 and click save.
screenshot of Service and Port
3) Change the Default Port Settings of the httpd.conf File
- Open config in Apache just right(next) to Apache admin Option and
click on that and select the first one (httpd.conf) it will open in
the notepad. - Locate 80( to get started, press Ctrl + F, then enter “80” in the
search field.) - Modify the following lines :
Port 80 to Port 8080
Listen 80 to Listen 8080
servername localhost:80 to servername localhost:8080
4) Update the Default Port Settings in the http-ssl.conf File
-
Open config in Apache just right(next) to Apache admin Option and
click on that and select the first one (http-ssl.conf) it will open
in the notepad. -
Locate 443( to get started, press Ctrl + F, then enter “443” in
the search field.) -
Modify the following sentences:
Listen 443 => Listen 4433 <VirtualHost _default_:443> => <VirtualHost _default_:4433> ServerName www.example.com:443 => ServerName www.example.com:4433
-
Now restart Apache and MYSql
-
Now type following in Browser : http://localhost:8080/phpmyadmin/
Note: you can use any other port
answered Jan 5 at 19:44
open D:xamppapacheconfextrahttpd-vhosts.conf
ServerName localhost
DocumentRoot «D:xampphtdocs»
SetEnv APPLICATION_ENV «development»
DirectoryIndex index.php
AllowOverride FileInfo
Require all granted
Restart Apache server
and then refresh your given url
answered Jul 16, 2016 at 12:31
PankajPankaj
1712 silver badges11 bronze badges
In my case, it was just a VPN problem.
I was working in my companies network (via VPN).
After switching to private network, the problem disappeared!
answered Oct 19, 2021 at 8:49
Max MarkMax Mark
712 silver badges9 bronze badges
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.
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.”
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:
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:
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.
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:
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
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:
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:
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.
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:
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:
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.
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:
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:xamppapacheconfig if you’re using 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:
Listen 80
ServerName localhost:80
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 xamppapacheconfextra.
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:
Listen 443
<VirtualHost _default_:443>
ServerName localhost:443
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.
Summary
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
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.
I am using XAMPP. and internal server of Django.
When I browse to localhost
or 127.0.0.1
, It shows
Not Found . HTTP Error 404. The requested resource is not found.
It sometimes works fine and other times pops up the error.
Moreover, when I browse to my project url, ie 127.0.0.1:8000/cc
, the project url works fine.
Any ideas why is this happening?
asked Jul 23, 2013 at 7:21
PythonEnthusiastPythonEnthusiast
16.3k43 gold badges132 silver badges256 bronze badges
You need to add the port number to every address you type in your browser when you have changed the default port from port 80.
For example: localhost:8000/cc .
A little edition here is that it should be 8080 in place of 8000.
For example —
http://localhost:8080/phpmyadmin/
answered Jul 23, 2013 at 16:59
1
I had the same problem and here is how it worked for me :
1) Open XAMPP control panel.
2)On the right top corner go to config > Service and Port setting
and change the port (I did 81 from 80).
3)Open config in Apache just right(next) to Apache admin Option and click on that and select first one (httpd.conf) it will open in the notepad.
4) There you find port listen 80 and replace it with 81 in all place and save the file.
5) Now restart Apache and MYSql
6) Now type following in Browser :
http://localhost:81/phpmyadmin/
I hope this works.
answered Dec 11, 2019 at 10:57
Many frameworks like Laravel
, Django
,… run local web server that work on another port except 80.For example port 8000
is the most commen port that these local web servers use.
So when you run web servers that frameworks build them and type localhost:8000
it works well.But web server that xampp(apache)
runs it has another port.In default it has 80
that it does not need to type it in url.And if you change port you should mention it in url.
**In brief:**web server in framework is different from web server in xampp . Check the port of each server and mention it in url when you use them.
answered Feb 14, 2020 at 17:21
akbarakbar
5795 silver badges12 bronze badges
If your server is still listening on port 80, check the permission on the DocumentRoot folder and if DirectoryIndex file existed.
answered Dec 26, 2014 at 8:42
KlausKlaus
4415 silver badges8 bronze badges
Try checking your web routes most likely there is nothing pointing to the default path in your routes //default path or route Route::get('/', [ PagesController::class,'index']);
in this case
answered Mar 2, 2021 at 11:58
If you are getting a 404 Error in PHP or you are not able to see PHPMyAdmin,
it might be you have changed your default port.
For instance, I have changed from port 80 to 8081. So after changing the port, you have to just type http://localhost:8081 in your browser.
eg: localhost:yourPortName/
phpmyadmin Page — http://localhost:8081/phpmyadmin/
answered Mar 14, 2022 at 5:15
- Open XAMPP control panel.
2)On the right top corner go to config > Service and Port setting and change the port. Under the Apache tab , change main port to 8080 and SSL port to 4433 and click save.
screenshot of Service and Port
3) Change the Default Port Settings of the httpd.conf File
- Open config in Apache just right(next) to Apache admin Option and
click on that and select the first one (httpd.conf) it will open in
the notepad. - Locate 80( to get started, press Ctrl + F, then enter “80” in the
search field.) - Modify the following lines :
Port 80 to Port 8080
Listen 80 to Listen 8080
servername localhost:80 to servername localhost:8080
4) Update the Default Port Settings in the http-ssl.conf File
-
Open config in Apache just right(next) to Apache admin Option and
click on that and select the first one (http-ssl.conf) it will open
in the notepad. -
Locate 443( to get started, press Ctrl + F, then enter “443” in
the search field.) -
Modify the following sentences:
Listen 443 => Listen 4433 <VirtualHost _default_:443> => <VirtualHost _default_:4433> ServerName www.example.com:443 => ServerName www.example.com:4433
-
Now restart Apache and MYSql
-
Now type following in Browser : http://localhost:8080/phpmyadmin/
Note: you can use any other port
answered Jan 5 at 19:44
open D:xamppapacheconfextrahttpd-vhosts.conf
ServerName localhost
DocumentRoot «D:xampphtdocs»
SetEnv APPLICATION_ENV «development»
DirectoryIndex index.php
AllowOverride FileInfo
Require all granted
Restart Apache server
and then refresh your given url
answered Jul 16, 2016 at 12:31
PankajPankaj
1712 silver badges11 bronze badges
In my case, it was just a VPN problem.
I was working in my companies network (via VPN).
After switching to private network, the problem disappeared!
answered Oct 19, 2021 at 8:49
Max MarkMax Mark
712 silver badges9 bronze badges
Why HTTP Error 404 Not Found issue occurs in XAMPP?
When you first installed XAMPP and activate the virtual host Apache, it will automatically forward it to the default port, usually port 80.
As you know XAMPP is a platform that uses the local resource as a base to develop any host-based application, the typical use is WordPress.
Whether you are a newbie or a vet in web and database development, you may come across a common issue with Apache localhost once you try to install Internet Information Services (IIS) among the most popular local web server XAMPP.
Once you enable IIS on your machine to learn a new CMS platform or develop apps or whatever you are trying to, you may get terrify when getting back to Apache and the browser throw you an error.
Base on my own experience, IIS is a sub-feature of Windows and can only be used when it is activated manually. If you would like to learn more about IIS, follow the guide Install IIS to host Sitefinity which will give you more insight about how to practice IIS in real life.
Since XAMPP is a third-party plugin or any similar application, its default port will be taken place by IIS. In other words, Microsoft Windows will take your default port back.
Fortunately, it is possible to generate another port to work separately. In fact, you can tell IIS to go somewhere else to play and you can keep your XAMPP playground untouched but this might be more complicated than moving the XAMPP port itself.
In this scroll, I will show you how to change XAMPP local port instead. There is a reason that you want to prevent making scratches on IIS system files due to its massive network optimized for local use already.
Fix 404 error from XAMPP after IIS setup
This is how your XAMPP Control Panel looks like after the IIS installation, the message indicates the port it was using is now lost:
Error: Apache shutdown unexpectedly. This may be due to a blocked port, missing dependencies, improper privileges, a crash, or a shutdown by another method. Press the Logs button to view error logs and check the Windows Event Viewer for more clues. If you need more help, copy and post this entire log window on the forums.
To fix this, look at the Apache section, click on Config and select Apache (httpd.conf). You will be taken to a Notepad window with its full configurations.
Press Ctrl-F and search for the line Listen 80.
Alter the number 80 to any number for example 1912 then a new line will look like this Listen 1912.
By doing this, you now successfully forced Apache to work on another port.
NOTE: Port number is dynamic, you can put your port number at your own choice, best practice is keeping it short and distinguishable.
Next, in the same file, look for another string ServerName localhost:80 and again, replace the 80 with the same port number as you determined earlier. They both must be the same.
After that, the new string will become Servername localhost:1912
By this step, you now assign a new DNS for your XAMPP Apache.
Restart the XAMPP Control Panel and reconnect again you will now see a new port associated with it.
With new port assigned, you have to include a suffix to your localhost since solely localhost has now been served to IIS only.
Your new link always contains 2 parts: localhost + NewPortSuffix. In this case localhost:1912/
PRO TIPS:
- If you are not sure what you are doing, back up your file before modifying it.
- You are fixing the 404 error for Apache only, the remaining features of XAMPP are still not reconfigured. Hence apply the same procedure for the rest for your own needs.
Conclusion
The issue is likely to occur for every application like XAMPP, no matter what app you are dealing with even MAMP, WAMP, AMPPS,… The default port 80 will be taken as soon as you activated the IIS.
The fix is simple, yet crucial for every developer because we don’t usually work with only one local server but more than one. I hope this helps you out and go get your projects back to the track.
If you have any simpler solution please share it with us or any similar issue or the solution that I gave was not reasonable do not hesitate to post your idea.
Прошу прощения за рекламу на сайте. Я постарался сделать это максимально ненавязчиво и по минимуму. При чтении заинтересовавших вас статей она не будет вам мешать.
И если есть возможность поставить мой сайт в исключения у блокировщика рекламы, я буду очень признателен вам.
Собираю простенький движок сайта на php. Делаю на локальном компьютере установив XAMPP.
С чем столкнулся?
С тем, что имея одну точку входа на сайт — index.php, не могу контроллером скрипта (index.php) проверить какой адрес вбит у клиентского браузера.
То есть если я открываю site1.loc
(адрес локального сайта), то index.php XAMPP`ом обрабатывается корректно и выдаётся результат работы скрипта.
Но, если я пишу адрес — site1.loc/contact
, то XAMPP выводит на экран, в браузер, ошибку 404 (страница не найдена), а не страницу с контактами.
Даже имея файл .htaccess
, всё равно была ошибка 404.
Оказывается, из-за того, что папка сайта находится не в директории по умолчанию, то на неё не распространяются правила описанные в файле конфигурации apache — httpd.conf
.
Решение
Добавил в конец файла httpd.conf
следующий блок кода:
AllowOverride All Order allow,deny Allow from all
Перезагружаем XAMPP и всё начинает работать как надо.
P.S. Для примера листинг файла .htaccess
AddDefaultCharset UTF-8 DirectoryIndex index.php index.html #Включаем работу механизма преобразования RewriteEngine on # {REQUEST_FILENAME} Полный путь в файловой системе сервера к файлу или скрипту соответствующим этому запросу. # [NC] - Регистр не имеет значения, т.е., нет различий между 'A-Z' и'a-z' # OR (либо следующее условие) Используйте для комбинирования условий в правилах OR вместо AND # -f СравниваемаяСтрока считается путем, проверяется существование этого пути и то что этот путь является обычным файлом RewriteCond %{REQUEST_FILENAME} -f [NC,OR] # -d СравниваемаяСтрока считается путем, проверяется существование этого пути и то что этот путь является каталогом. RewriteCond %{REQUEST_FILENAME} -d [NC] RewriteRule .* - [L] #site.ru/cat/dev/, сервер через .htaccess будет обрабатывать команду — site.ru?id=cat&p=dev #RewriteRule ^([a-z]+)/([a-z]+)/$ ?id=$1&p=$2 [L] # site.ru/primer/, сервер через .htaccess будет обрабатывать команду — site.ru?id_news=primer #RewriteRule ^([a-z]+)/$ ?id_news=$1 [L] RewriteRule ^(.*)$ ?path=$1 [QSA,L]
XAMPP, 404 ошибку всех ссылок кроме главной
18 сентября 2018, 18:16
Александр
Linux
0
259
0
BTC Bitcoin Price calculator and Converter online | Beaxy.com
Из этой категории
-
Opera не русифицируется в Linux
Как исправить ошибку запуска VirtualBox VM в Linux
Не могу записать ничего на ext4
Как установить или удалить ядро Liquorix Linux Mint
13 горячих клавиш в bash Linux
Советы и приемы настройки командной строки в Bash Linux
Как определить папки занимающие большое пространство на диске, в Linux
Как скопировать файлы с помощью команды ср в Linux
Автоматическая перезагрузка при kernel panic
Opera не показывает некоторые видео в linux
Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
I’m using Windows. I am trying to connect using localhost/test.php after I installed XAMMP. I keep getting a 404 error. I can’t seem to figure it out.
13 Answers
STAFF
Cool! Let me know if you have any more trouble getting it to work. :~)
Did you start the server? You have to launch the app then on the application you’ll click a button to start servers.
mahmoud saeed March 20, 2013 3:01pm
Yes I start running Apache. Correct ports and all. Could a Firewall have anything to do with it?
STAFF
Is the test.php file in the htdocs directory? How do you know its a 404 error and not a 500 error? What is the code in that test.php file?
mahmoud saeed March 21, 2013 2:10am
I have the test.php file in the htdocs folder. In that folder i have 3 other folders (forbidden, restricted & XAMMP) when i type in the site localhost/test.php it says the following…
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
Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
The code that is in the test.php file is this:
<?php
«Hello World»;
?>
mahmoud saeed March 21, 2013 2:22am
It pulls up the orange XAMMP site from the video (looks like a homepage to me)
STAFF
Try adding an echo command to your test.php file:
<?php echo "Hello World"; ?>
(Without that echo statement, it won’t display anything.) Any chance that fixes it?
mahmoud saeed March 21, 2013 2:29am
Not fixed. Same thing. I remember from your video that you did something with the firewall. Would that have anything to do with it? Im also running Vista.
STAFF
If the ports or the firewall weren’t set correctly, then I don’t think you could see the localhost/xampp page.
What happens when you go just to [http://localhost/]?
mahmoud saeed March 21, 2013 2:36am
It won’t let me. It defaults to the XAMMP page. localhost/xammp/
STAFF
What folder is all this in? Is it [c:xampphtdocs]?
mahmoud saeed March 21, 2013 2:44am
Ahhh!!! There we go. The folder I had this on was a desktop shortcut. I wasn’t using the above example and I remembered that part now. You are awesome thank you so much. Can’t say enough good things about you guys!