Why can't CakePHP bake connect to MySQL running under EasyPHP on Windows Vista Ultimate?

拜拜、爱过 提交于 2019-12-24 08:06:16

问题


I CakePHP (cake_1.2.2.8120) and EasyPHP (3.0) installed on Windows Vista Ultimate. I followed the "baking" tutorials online, successfully set the database connection with the "cake bake" command from the CLI.

I baked the controller for my "Users" table using the "php cake.php bake controller Users" command - worked fine. However, when I tried baking the view similarly, I got this message:

Fatal error: Call to undefined function mysql_connect() in C:\Web\EasyPHP
\www\cake\cake\libs\model\datasources\dbo\dbo_mysql.php on line 374'

Also, the mysql module is enabled for PHP on the phpmyadmin page (web), but I can't find it in the CLI (using "php -m" from the command line) even though I've uncommented the "extension=php_mysql.dll" line in the php.ini file.

Any clues?


回答1:


Grab XAMPP which has apache with the mysql and php modules setup and working together, as well at the mysql and command-line versions. It just unzips to any directory so it won't mess up any other apache installs you have, just be careful of any port conflicts between the different installations.

http://www.apachefriends.org/en/xampp-windows.html




回答2:


The root cause of problem is that in EasyPHP 5.3 there is no php.ini file in php folder. Copy php.ini from EasyPHP5.3\apache to EasyPHP5.3\php to solve this nasty issue.




回答3:


Don't know EasyPHP, but it seems to be Apache based. Check if you're using a Apache-module for the mysql-connection, as this will not work in CLI.




回答4:


copy the apache/php.ini to php/php.ini.



来源:https://stackoverflow.com/questions/828899/why-cant-cakephp-bake-connect-to-mysql-running-under-easyphp-on-windows-vista-u

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!