We help IT Professionals succeed at work.
Troubleshooting Question

wp-login.php was not found on this server.

Hassan Alhusseini
on
66 Views
Last Modified: 2020-09-28
Hello
I have this message when trying to go to the login

The requested URL /wp-login.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

The file exists in the root folder

the home and the siteurl fields in the DB are totally correct

Any ideas?

Thanks for help



Comment
Watch Question

65tdRetired
CERTIFIED EXPERT

Commented:
What web server is being used?
Apache sets it website folders under /var/www/html
PHP is configured access files from that path.
Using the root folder the file and folders issues are permissions related. 
ste5anSenior Developer
CERTIFIED EXPERT

Commented:
When it is a new setup and not a hacked machine, then your paths are the problem.

You should not use the root folder.
home is not relevant, as long as you don't have specific certification requirements.

The first thing is to check url rewrite and .htaccess.
Also test http and https to your site.
Activate the PHP test page and try to visit it.
David FavorFractional CTO
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
You said, "The file exists in the root folder".

This might or might not be meaningful. For example...

1) Apache (or whatever Webserver you're using) might be pointing to some other directory.

2) Directory or file ownership might be incorrect.

3) Directory of file permissions might be incorrect.

To many variables.

Bottom line, is you'll debug this looking at your logs, as your logs will specify the exact/absolute path of the wp-login.php you're trying to access.

You'll take the Apache (or whatever) error log file + fix problem so the exact/absolute file path is what Apache expects.

Only a few seconds to debug this, by looking in your log files.

Author

Commented:
Hello again
I will explain the situation again :)

I have a wordpress website working on Apache server. The files for the wordpress is under a folder called "ssx"
Now when under the "ccs" folder I have the file "wp-login.php" ( I think this file is the file to access the wordpress website and manage the content)

When I try to access this page by "http://www.whatever.com/ssx/wp-login.php" I have the message:
The requested URL /wp-login.php was not found on this server.

The requested URL /ssx/wp-login.php was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

The file permission is 644

If I tried to do the same with http://www.whatever.com/ssx/wp-admin.php" ... I will have the same results

The website is working without any problem. But I need to update the content.
 
Where should I start to investigate the problem

Thanks for your help



ste5anSenior Developer
CERTIFIED EXPERT

Commented:
I don't know, why you need the ssx folder, but the css folder is for cascading style sheets, not for PHP code.
Scott FellDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2013

Commented:
Did you ever change where your admin portal points to?  

Author

Commented:
Hello Scott
  I do not know... How can I check?
Scott FellDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2013

Commented:
What happens when you just go to yourdomain.com/ssx/wp-admin/ instead of the PHP page?
Scott FellDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2013

Commented:
You can check your htaccess or web.config to see if there are any clues?  You may have a plug in that is doing this.

Is this a new install or an old site?

Author

Commented:
Hello Scott

The same results

The requested URL /ssx/wp-admin/  was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Author

Commented:
Hello Scott
this is an old one

Author

Commented:
Hello Scott
for the plug in : I rename the plugin directory as to check and still the same problem

Scott FellDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2013

Commented:
David mentioned looking at the logs and that may be a good clue.  Though for recent activity I suspect it will just show the 404.  Perhaps you can find older entries of when you were able to use Admin and what that URI is.

It was mentioned to look at your htaccess or web.config for clues too.


David FavorFractional CTO
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
The following is an incorrect WordPress install + will never work...

I have a wordpress website working on Apache server. The files for the wordpress is under a folder called "ssx"
Now when under the "ccs" folder I have the file "wp-login.php" ( I think this file is the file to access the wordpress website and manage the content)

Referring to your "The requested URL /ssx/wp-login.php was not found on this server" message.

If you have your WordPress files in /ssx/css then this is the problem... because...

/ssx/wp-login.php != /ssx/css/wp-login.php

Tip: Your DocumentRoot, as referenced in your Webserver config, is where your WordPress files should live.

You can attempt a different setup... If you do, you'll have continual complexities + problems...
Terry WoodsWeb Developer, specialising in WordPress
CERTIFIED EXPERT
Most Valuable Expert 2011

Commented:
An installation of the core WordPress files, as David says, is not typically separated like you describe.

If you download and review an installation .zip file for WordPress, you'd get a good idea of where the WordPress core files should go. They include 3 folders (wp-content, wp-includes and wp-admin) and then a collection of other files (mostly .php files, including wp-login.php, that sit at the same level as the folders. If you don't have these files sitting in those locations, relative to each other, then the installation likely won't work (at least, without customisations of some sort).


David FavorFractional CTO
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Aside: Just thinking about Terry's comment.

Likely best to mention some useful WordPress hygiene.

Background: I manage 1000s of WordPress sites... all day... every day... running in 100s of LXD containers... across many Linux machines...

Sigh... I've seen many catastrophes which could have been easily avoided...

WordPress Hygiene Best Practices - I use...

1) WordPress installs only occur inside a site's DocumentRoot.

Said differently, I never allow a static site to run out of DocumentRoot, then have a nested WordPress install... like... /blog or /members running WordPress.

2) I only allow a single WordPress install per site, where a site is a bare domain (foo.com) or a host (blog.foo.com or members.foo.com) never any nested installs.

Said differently, inside a single DocumentRoot hierarchy, only 1x instance of a wp-config.php file exists.

This stops the problem of one nested install being hacked, which leaks to all other installs.

History Lesson: I once took on a new project consisting of 100s of WordPress installs. Some hosts had 10-15x+ nested WordPress installs.

This had resulted in a total of nearly 14,000 hacked files.

I took months to cleanse all hacks.

This could have all been avoided by using basic WordPress Hygiene Best Practices.

3) All sites run HTTPS + HTTP2 + Brotli with high speed HTTPS config settings.

Note: I mention this because, it sounds like maybe you're trying to install multiple sites (bare domains and/or hosts) inside one DocumentRoot hierarchy... which is a recipe for man disasters of various forms...

If this is the case, revise your thinking to...

Once site per DocumentRoot.

Author

Commented:
hello again..
So I have an additional information: The guy who install the site said that it is not working because of the hosting Apache server have an old php version

My question is: How can I make a complete local copy in my XAMPP server as to test the website?

Can someone tell me the steps for doing so.... or any reference can help?

Thanks for your help
Scott FellDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2013

Commented:
I would say that does not completely sound right because the site works, just not admin because you are getting a 404.  The PHP version may be out of date and need upgrading, but that shouldn't give you a 404 which means not found.

To get a local copy of your site, you can manually download the WP files and export/import the database but it will probably b easier to use a plug in https://wordpress.org/plugins/duplicator/

Author

Commented:
Hello Scott
  Thanks for your help..
I can not use that plugin as it required to access the wp-admin page

Is there any link to guide me on how to do the replication manually ?

Thanks for your help
David FavorFractional CTO
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
1) So I have an additional information: The guy who install the site said that it is not working because of the hosting Apache server have an old php version.

As Scott said, your "guy" is 100% wrong.

A 404 is a missing file.

A 500 (Internal Error) or a WordPress error (shows up in debug.log when WP_DEBUG is enabled) when there's a WordPress/PHP version mismatch.

Tip: Time to fire your "guy", then get a more competent "guy".

2) My question is: How can I make a complete local copy in my XAMPP server as to test the website?

Well you can do this... if you have lots of free time + money.

Or you can just setup a LAMP server + install WordPress.

Tip: Since you're having problems already, trying to move a broken XAMPP setup somewhere else, is just another several layers of problems.

3) Can someone tell me the steps for doing so.... or any reference can help?

See #3.

For a walk through of setting up a LAMP server, open another question.
David FavorFractional CTO
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Note: If you never had WordPress working, there's nothing really to migrate.

Just do a fresh WordPress install.

If WordPress was working before, open another question about how to migrate a broken WordPress install.
Developer
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2013
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Dears,
  Thank you for your great help. After installing the website in a local sever, I can login to the admin page. But, the main page have the header links but it does not display the content of the page itself.  I think there is a plugin problem . my question is: how to know which plugins is working in the main page of the website

loading and nothing else

If I go to other pages ... the same.. No displayed data just loading sign as shown

Thanks a lot for your help
David FavorFractional CTO
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Likely best to close out this question + start another, as this question is beginning to cover different topics than the original question.

And... to understand what's occurring with your entire WordPress Stack (core + theme + plugins), enable WP_DEBUG, then review your debug.log file deposited in your site's DocumentRoot directory.

If you require help decoding problems you find, be sure to open a new question.
Scott FellDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2013
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.