0

My application gives error

Class PDO not found

If i use php -m command it does not list pdo but in that directory has a pdo.so file. In php.ini file i configure extension command for pdo.so. How to fix this issue? My server space doesn't have internet therefore i use rpm installation.

I tried with installing diffrent pdo version using rpm files. but still not working and always give the same error

James Z
  • 12,209
  • 10
  • 24
  • 44
  • Please see https://stackoverflow.com/questions/2320644/how-do-i-enable-pdo-using-centos – Alpy Apr 24 '19 at 14:18
  • 1
    Possible duplicate of [How do I enable PDO using CentOS?](https://stackoverflow.com/questions/2320644/how-do-i-enable-pdo-using-centos) – Matthias Beaupère Apr 24 '19 at 14:31
  • In my case i found two php.ini files. php info () shown path is /opt/remi/php56/root/etc and other one located in /etc. when i issue php --ini command in command line it gives Configuration File (php.ini) Path: /etc if there has aproblem? – Thilanka Umayanga Jayarathna Apr 25 '19 at 03:35

1 Answers1

-1

Be sure to yum install php-mysql php-pdo. Centos does not allow phpenmod commands so you will be required to edit the php.ini file and uncomment the extension=pdo_mysql.so. Then service httpd restart.

GingaWRATH
  • 98
  • 4
  • its uncommented. In my case i found two php.ini files. php info () shown path is /opt/remi/php56/root/etc and other one located in /etc. when i issue php --ini command in command line it gives Configuration File (php.ini) Path: /etc if there has aproblem? – Thilanka Umayanga Jayarathna Apr 25 '19 at 03:37
  • Typically php -i will serve yoyr php cli and the ini is found in the /etc directory. Restarting apache is a must after editing the ini file. Check if you have a etc/php/modules directory and if you have a pdo-ext or something similar. Failing all this I would recommend upgrading php to php7 and using phpenmod pdo_mysql I believe. – GingaWRATH Apr 25 '19 at 07:01