我已经在我的linux系统上安装了Lampp,并且我正在学习symfony2,同时尝试使用symfony2命令创建模式
php app/console doctrine:schema:create
我收到以下错误消息:-
PDOException “could not find driver”
我还在 php.ini 文件中取消注释此行 extension=php_pdo_mysql.dll
我尝试查找并搜索我的问题,但无法解决我的问题。当我运行 php -m 命令时,我得到以下结果:-
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/mysql.so' - /usr/lib/php5/20090626+lfs/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/mysqli.so' - /usr/lib/php5/20090626+lfs/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/pdo_mysql.so' - /usr/lib/php5/20090626+lfs/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 [PHP Modules] bcmath bz2 calendar Core ctype date dba dom ereg exif fileinfo filter ftp gettext hash iconv json libxml mbstring mhash openssl pcntl pcre PDO ---- ----
有什么办法可以消除这个问题吗?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
在Ubuntu中,在控制台中写入
它会起作用
希望您正在本地主机中运行您的项目。在你的项目文件夹 app/config 中有一个名为parameters.ini的文件,确保你的Mysql数据库连接配置正确。如果您使用 mysql,请参阅
database_driver=pdo_mysql是它的驱动程序。下面是一个示例。
database_driver = pdo_mysql database_host = localhost database_port = database_name = databasename database_user = msqlusername database_password = mysqlpassword//if not make blank mailer_transport = smtp mailer_host = localhost mailer_user = mailer_password = locale = en secret = ThisTokenIsNotSoSecretChangeIt希望对您有帮助。