Maybe your host is not install pdo extension yet.
Use "yum install php-pdo" and "yum install php-pdo_mysql" command to install it
Then add these line into you php.ini file
extension=pdo.so
extension=pdo_mysql.so
p/s: Sorry for my bad English
I try sudo apt-get install php5-gd php5-mysql
, but now it show
[PDOException]
SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '
/var/run/mysqld/mysqld.sock' (2)
sometimes in you db.config you cannot use locahost as one of the params (host, i believe) so try 127.0.0.1 instead
also in command line do mysql -u username -h localhost -p <enter password>
if this works then use these details in laravel config..
I have the same problem, but solved. It's caused because we installed other php binary accidentally and the system uses that instead of LAMPP's php binary.
Here is my solution: Make sure your php binary is point to /opt/lampp/bin/php or /opt/lampp/bin/php-5.x.x by running the command "which php". If your php was pointed to /usr/bin/php, make sure it's a symlink of /opt/lampp/bin/php OR /opt/lampp/bin/php-5.x.x
try this:
(in case: installing migrate) /opt/lampp/bin/php artisan migrate:install
you'll not see any erros in case you've updated the .env file to your own configuration
yuomtheara said:
I try
sudo apt-get install php5-gd php5-mysql
, but now it show[PDOException] SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket ' /var/run/mysqld/mysqld.sock' (2)
You just change hostname from .env or config/database.php from localhost to 127.0.0.1
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community