Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Apr 28, 2014 12:25 pm 
Offline
Newbie

Joined: Mon Apr 28, 2014 12:04 pm
Posts: 3
Hi, I have a problem with my linode server configuration, after installing a lamp with Ubuntu 12.04 lamp stackscript.

When I run a php script with apache php, all its ok, but when I run this script with PHP CLI, I always get this error:

php -qn -d memory_limit=128M script.php

Fatal error: Class 'PDO' not found in script.php on line 51


But PDO is enabled in all php runtimes configurations (apache and cli).

If I run:

php --ini

I get:

Configuration File (php.ini) Path: /etc/php5/cli
Loaded Configuration File: /etc/php5/cli/php.ini
Scan for additional .ini files in: /etc/php5/cli/conf.d
Additional .ini files parsed: /etc/php5/cli/conf.d/curl.ini,
/etc/php5/cli/conf.d/gd.ini,
/etc/php5/cli/conf.d/mcrypt.ini,
/etc/php5/cli/conf.d/mysql.ini,
/etc/php5/cli/conf.d/mysqli.ini,
/etc/php5/cli/conf.d/pdo.ini,
/etc/php5/cli/conf.d/pdo_mysql.ini

So, php CLI has pdo.ini loaded.

Any suggestion?

It could be a permissions issue, related with pdo.so module?


thanks in advance


Top
   
PostPosted: Mon Apr 28, 2014 12:46 pm 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
What do you get when you run a script with phpinfo() in it from the command line? Are the PDO entries in there?

What's in /etc/php5/cli/conf.d/mysqli.ini, pdo.ini and pdo_mysql.ini?


Top
   
PostPosted: Mon Apr 28, 2014 1:11 pm 
Offline
Newbie

Joined: Mon Apr 28, 2014 12:04 pm
Posts: 3
Thanks for your answer: phpinfo() returns this in relation to PDO:

php -r "phpinfo();"

PDO

PDO support => enabled
PDO drivers => mysql

pdo_mysql

PDO Driver for MySQL => enabled
Client API version => 5.5.37

Directive => Local Value => Master Value
pdo_mysql.default_socket => /var/run/mysqld/mysqld.sock => /var/run/mysqld/mysqld.sock

mysqli.ini contains:

extension=mysqli.so

pdo.ini:

extension=pdo.so

pdo_mysql.ini:

extension=pdo_mysql.so

Thanks again


Top
   
PostPosted: Mon Apr 28, 2014 4:11 pm 
Offline
Newbie

Joined: Mon Apr 28, 2014 12:04 pm
Posts: 3
Sorry, my fault

php -qn -d memory_limit=128M script.php

-n tells php runtime to not use ini file.

Thank you for your time


Top
   
PostPosted: Mon Apr 28, 2014 4:51 pm 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
azabala, I'm glad it worked out.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group