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

我安装了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>

展开原文

原文

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?

1个回答



如果您使用的是PHP-FPM:</ p>

  sudo service php5-fpm restart

</ code> </ pre>

PHP在自己的进程中运行。 Nginx配置无关。</ 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.

dsf6281
dsf6281 谢谢! 我忘了重启那个
6 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐