dongxuying7583
2014-01-14 10:27
浏览 48
已采纳

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?

图片转代码服务由CSDN问答提供 功能建议

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

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

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

  sudo service nginx restart 
   
 
 

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

  sudo  mysql_install_db 
   
 
 

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

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

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dousi1970 2014-01-14 10:30
    已采纳

    If you are using PHP-FPM:

    sudo service php5-fpm restart
    

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

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题