PHP nginx mysql:致命错误:在第12行的/var/www-git/www1/api/credentials/mysql.php中调用未定义的函数mysql_connect()

PHP nginx mysql:致命错误:在第12行的/var/www-git/www1/api/credentials/mysql.php中调用未定义的函数mysql_connect()

问题描述:

I have installed mysql-server php5-mysql and nginx. When I execute a script (by webrequest) it outputs the error:

Fatal error: Call to undefined function mysql_connect() in /var/www-git/www1/api/credentials/mysql.php on line 12

This tells me that mysql api cannot be found, I guess. I have restarted nginx.

sudo service nginx restart

checked php.ini for any msql related settings(found none but this could maybe be the error) I also ran this(without really knowing why it initiates the dbs I guess so I do not think its important):

sudo mysql_install_db

I don’t know what to look for in phpinfo(), I checked but found nothing relevant.

Why can't PHP, in my current nginx setting, find mysql?

我安装了mysql-server php5-mysql和nginx。 当我执行脚本(通过webrequest)时,它输出错误: p>

 致命错误:在/ var / www-git / www1 / api /中调用未定义的函数mysql_connect() 第12行的凭证/ mysql.php 
  code>  pre> 
 
 

这告诉我无法找到mysql api,我猜。 我重新启动了nginx。 p>

  sudo service nginx restart 
  code>  pre> 
 
 

检查php.ini是否有任何与msql相关的设置( 发现没有,但这可能是错误) 我也运行了这个(不知道为什么它启动dbs我想我觉得它不重要): p>

  sudo  mysql_install_db 
  code>  pre> 
 
 

我不知道在phpinfo()中要查找什么,我检查过但发现没什么相关的。 p>

为什么PHP,在我当前的nginx设置中找不到mysql? p> div>

If you are using PHP-FPM:

sudo service php5-fpm restart

PHP ran in its own process. Nginx configuration has nothing to do.