Ubuntu 18.04上的PHP启动问题

时间:2018-11-28 17:57:08

标签: php ubuntu

我正在使用Apache和PHP 7.2运行Ubuntu 18.04。一切正常。我的查询工作正常,但有时会收到带有以下说明的错误报告

npm WARN checkPermissions Missing write access to /Users/kennyquach/.npm-global/lib/node_modules/create-react-app
npm ERR! path /Users/kennyquach/.npm-global/lib/node_modules/create-react-app
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/Users/kennyquach/.npm-global/lib/node_modules/create-react-app'
npm ERR!  { Error: EACCES: permission denied, access '/Users/kennyquach/.npm-global/lib/node_modules/create-react-app'
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/Users/kennyquach/.npm-global/lib/node_modules/create-react-app\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/Users/kennyquach/.npm-global/lib/node_modules/create-react-app' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/kennyquach/.npm/_logs/2018-11-28T17_50_32_739Z-debug.log

我试图在php.ini中搜索它,但是找不到问题。我试图用Google搜索它,但找不到相同的问题。

有人知道是什么原因造成的,我该如何阻止它?

grep enter image description here的结果

2 个答案:

答案 0 :(得分:1)

您没有安装php-mysql。要安装它,请打开终端并运行以下命令:

sudo apt install php-mysql

之后,您需要重新启动apache:

sudo service apache2 restart

您可以使用以下命令行检查是否安装了mysqli:

php -i | grep mysqli

答案 1 :(得分:0)

我遇到了同样的问题,我解决了更改php.ini的问题

来自:

extension=mysqli

至:

;extension=mysqli

因为所有mysqli设置已经在这里:

/etc/php/7.2/cli/conf.d/20-mysqli.ini