I ran if
(!defined('PDO::ATTR_DRIVER_NAME')) { echo 'PDO unavailable'; }
and it came up unavailable
Hey even i am facing problem can you please let me know how did you fix this issue ?? Please
also facing this Fatal error: Call to undefined function Illuminate\Foundation\Bootstrap\mb_internal_encoding() in /home/my_user/public_html/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 43
Same here.. When I run print_r(PDO::getAvailableDrivers());
it outputs ['0'=>'sqlite','1'=>'mysql']
. Here is the output of my php -i | grep pdo
:
'./configure' '--disable-fileinfo' '--disable-opcache' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-intl' '--enable-libxml' '--enable-mbstring' '--enable-pdo=shared' '--enable-soap' '--enable-sockets' '--enable-wddx' '--enable-zip' '--prefix=/usr/local' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-bz2' '--with-curl=/opt/curlssl/' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-icu-dir=/usr' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libexpat-dir=/usr' '--with-libxml-dir=/opt/xml2' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mm=/opt/mm/' '--with-mysql' '--with-mysqli' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pic' '--with-png-dir=/usr' '--with-snmp' '--with-tidy=/opt/tidy/' '--with-xmlrpc' '--with-xpm-dir=/usr' '--with-xsl=/opt/xslt/' '--with-zlib' '--with-zlib-dir=/usr' 'LDFLAGS= '-L/usr/X11R6/lib64''
Still php artisan
throws Fatal error: Class 'PDO' not found in /home/erturanc/Code/test/config/database.php on line 16
.
I figured out the problem. Yes, I have successful installation of PDO, I can use it everywhere.. But somehow it is not enabled on php-cli. I am using Centos with PHP5.6, cPanel & WHM. Still trying to figure out how to enable it for cli.
I solved the issue.
I run php-cli --ini
and it points to /usr/local/bin/php.ini
. I edit an add the followings:
extension=pdo.so
extension=pdo_sqlite.so
extension=pdo_mysql.so
A bit insensible because it was working through browser calls anyway. However, now it works.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community