0

I'm installing WordPress through Xampp. I used to work with MAMP and it basically works the same way.

Normally I do everything manually as in copying the files and installing the database.
When loaded the famous "can't establish database connection" kicks in.
Now I thought this might have something to do with the fact that MAMP and Xampp have some minor differences. So I decided to use the WordPress installer.

After placing the files in XAMPP->xamppfiles->htdocs->customFolder I ran the installer.

Database is created in phpMyAdmin and I expect the installer to finish after adding the credentials. But nooooo. For some reason this sob keeps denying the wp-config.php to be created.

I quadruple checked every credential of the database. Have no idea on why step2 fails to install WordPress.

So I might think this is an port issue. I have also installed MAMP and it is running on port:8080. After setting xampp to port:8080 it gives me an error saying it can't bind to that port. Changed it to port:8666 but the same problem occurs.

Any thoughts or extra info?

---- UPDATE --- So I created the wp-config.php manually and got these extra error messages. All files in the htaccess folder have now file permission 777. This is merely for testing and would never happen in a live environment.

Warning: mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in /Applications/XAMPP/xamppfiles/htdocs/testing/wp-includes/wp-db.php on line 1531

Interactive
  • 1,474
  • 5
  • 25
  • 57

5 Answers5

0

There must be file permission issue, You must grand 777 rites to create wp-config file. chmod 775 wp-content/upload Also note All files should be owned by the actual user's account, not the user account used for the httpd process. Group owneraship is irrelevant, unless there's specific group requirements for the web-server process permissions checking. This is not usually the case. All directories should be 755 or 750. All files should be 644 or 640. Exception: wp-config.php should be 440 or 400 to prevent other users on the server from reading it. No directories should ever be given 777, even upload directories. Since the php process is running as the owner of the files, it gets the owners permissions and can write to even a 755 directory.

Fahad Imtiaz
  • 29
  • 1
  • 7
  • Did this. The complete htdocs folder (including childfolders) have a 777 permission (testing purposes) but still won't go..... – Interactive Mar 05 '18 at 10:58
  • mysql user do not have proper permission. grand all privileges to mysql user , and make sure you are using correct username and password. – Fahad Imtiaz Mar 05 '18 at 12:15
  • Motherf.... So I was checking the privileges. Found that the root user doesn't use a password. MAMP does this.. – Interactive Mar 05 '18 at 12:18
0

It sounds like a folder/file permissions issue rather than a port issue.

This question should help you solve the permissions on your xampp/xamppfiles/htdocs/customfolder

XAMPP permissions on Mac OS X?

When WordPress gives that error it's most often because it can't create the wp-config.php file due to insufficient write permissions.

lin web
  • 45
  • 4
  • Did this. The complete htdocs folder (including childfolders) have a 777 permission (testing purposes) but still won't go..... – Interactive Mar 05 '18 at 10:58
0

I found the solution.

MAMP uses a user root and password root.
XAMPP in contrast to MAMP doesn't.

The user name is root but the password is empty..... enter image description here

Interactive
  • 1,474
  • 5
  • 25
  • 57
0

I faced this issue attempting to install within XAMPP and what solved it for me was to run XAMPP as administrator. This reflects other answers referring to permissions.

The other thing that can be an issue is XAMPP timing out on the install. One can modify their php.ini file within xampp to increase the max execution time. As they say "I hope this helps"

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 90
0

I had same issue using XAMPP 8.1.12 on WINDOWS 10; Try installing an older version, in my case XAMPP 8.0.25 fixed the problem.

Marcus
  • 1
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 29 '22 at 08:34