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

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?

  • 写回答

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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图2.0 版本点聚合中Marker的位置无法实时更新,如何解决呢?
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题