Wordpress Database Connection Error - PHP7 using MAMP - wordpress

I have a localhost development environment using MAMP Pro, with a Wordpress website working successfully using PHP 5.6.8. Changing the host to PHP 7.0.13 (and changing nothing else) results in the error:
Warning: mysqli_real_connect(): (HY000/2002): No such file or
directory in [edited path]/wp-includes/wp-db.php on line 1538
Error establishing a database connection
This either means that the username and password information in your
wp-config.php file is incorrect or we can’t contact the database
server at localhost:3306. This could mean your host’s database server
is down.
Screenshot of Complete Error
wp-config.php definitely has correct username, password, hostname and the database is running. Solutions to similar issues/warnings suggest the MySQL socket path in php.ini file could be wrong, but I have compared that file across the two php versions and they are the same.
I am using the latest versions of MAMP Pro (4.1) and Wordpress (4.7.4), as well as OS X (10.12.4). Also, the website works fine again when changing the host back to PHP 5.6.8.
No idea what else to do/check. Any thoughts are much appreciated.

Wordpress 4.6 later version is not supported in Php 7.0 So please Reinstall Php 5.6 and check .so working

After updating to PHP7 you need to check the path to the mysql.sock.
Open the php.ini file and correct the path
mysql.default_socket = /Applications/MAMP/bin/IDONTKNOW...../mysql.sock

Related

WordPress Settings / General / Site Language Option Disappear - Mac OS

While I try to change WordPress language on localhost Mac OS machine, I got this Warning message and I couldn't find Site Language option on General Settings page.
Warning: An unexpected error occurred. Something may be wrong with
WordPress.org or this server’s configuration. If you continue to have
problems, please try the support forums. (WordPress could not
establish a secure connection to WordPress.org. Please contact your
server administrator.) in
/opt/lampp/htdocs/wordpress/wp-admin/includes/translation-install.php
on line 65
My WordPress is the latest version 4.9.1
Some people in WordPress support suggest to check the installation of curl in XAMPP web server and I check it and it works well. link
I also checked the privilege of ../wordpress/wp-content/languages/ directory and chmod to 777
Any help, please?
I switched from XAMPP to MAMP and this problem is solved.

Getting error while installing the setup of magento2 on ubuntu?

when i'm entering the domain-name or IP on the browser for setup of magento2, then its shows me this error.
please check htaccess file. Rename htaccess file then again check.
check your php install or not. If installed then check its version beacuse magento 2.0 version working on 7.0.2 php.
check here requirement

Ubuntu 16.04 - Cannot Open PhpMyAdmin after do full installation

I have minor problem here. I try to install phpmyadmin in my machine. Before I start install phpmyadmin, I have done installing LEMP.
Details:
Ubuntu 16.04
Nginx 1.9.15
MySQL 14.14
PHP 7.0.4
Steps for install phpmyadmin I follow here:
How To Install and Secure phpMyAdmin with Nginx on an Ubuntu 14.04 Server
After I done with installing phpmyadmin then I go to my web browser and click this http://server_domain_or_IP/phpmyadmin. It should show up interface of phpmyadmin. But mine show a pop out like this.
I do not have an idea what is happening. Hope anyone can help me.
thank you!
It seems like nginx is running but doesn't know how to handle the PHP processing. Try
service nginx restart
If that doesn't work, try making a basic PHP file in the server root, something like:
<?php echo "PHP is working"; ?>
And see if you can get that to load properly.
If you pass those two steps and still have trouble, my next guess is that the phpmyadmin site is not properly enabled. Check that the link for the site points to the right place. This talks about virtual hosts (albeit for Ubuntu 12.04 but should work):
https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3
If it still doesn't work, you can download the tar.gz of phpMyAdmin and manually configure to see that it gets going.

Can't install Acquia Drupal Commons locally

Working on a MacbookPro OS 10.6.6 , using MAMP Pro 1.9.4.
I'm attempting to install Acquia's Drupal Commons locally. The installation progress bar goes all the way, I can check in phpMyadmin that the database has been populated, but before the site configuration screen , I get a 500 Server Error!
Standard Drupal 6 or 7 install without any problem & I was able to install Drupal Commons on my web server. So it seems that some form of conflicts happens between my server configuration ( Mamp Pro ) and Drupal Commons.
Thanks in advance for any suggestions!
Did you check that your sites/default/default.settings.php file was copied to settings.php and not just renamed?
I remember having problems setting up Drupal when I just renamed it, both files need to be there.
I solved the issue by raising the PHP limit in Mamp to 96M.
File > Edit Template > PHP > PHP Version
//Search for 'memory_limit' & edit the value
memory_limit = '96M';
then restart the server.
After dong this Drupal Commons should install without any problems.

Drupal 7 configuration error with Postgresql in Mac OS 10.6.5

I am trying to configure Drupal 7 with Postgres. At the database setup step, I get the following error.
Warning: PDO::_construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in DatabaseConnection->_construct() (line 300 of /Users/shamod/Sites/drupal/7/includes/database/database.inc).
In order for Drupal to work, and to continue with the installation process, you must resolve all issues reported below. For more help with configuring your database server, see the installation handbook. If you are unsure what any of this means you should probably contact your hosting provider.
Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2002] No such file or directory.
Is the database server running?
Does the database exist, and have you entered the correct database name?
Have you entered the correct username and password?
Have you entered the correct database hostname?
NOTE: I am trying to connect to Postgresql but it fails on var/mysql/mysql.sock error. I have setup the database connection string in settings.php for Postgresql. It still does not work.
Any idea?
Evidently you are trying to connect to a MySQL database instance, so you should review your database driver and connection configuration.
Just came up against this error myself when trying to use the web installer - might come down to a similar issue.
On the install page I wasn't given an option to use Postgres driver so I assumed I needed to use the "Mysql (or other)" option. However, looks like the Drupal install script checks which database drivers are compiled into PHP and only offers you what is available - my system didn't have php-pgsql installed by default.
So I needed to install the postgresql drivers to PHP first, reload apache then try the install again.
On CentOS-5:
sudo yum install php-pgsql
sudo service httpd restart
Then reload the install page and all worked fine.

Resources