我正在尝试在 UBuntu 上运行一个 php 项目。它有一个创建 mysql 数据库的安装脚本。当我尝试运行脚本时,出现以下错误:
Warning: fopen(dbinfo.php): failed to open stream: Permission denied in /opt/lampp/htdocs/project/install.php on line 12
Warning: fwrite() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/project/install.php on line 19
Warning: fclose() expects parameter 1 to be resource, boolean given in /opt/lampp/htdocs/project/install.php on line 20
Warning: include(dbinfo.php): failed to open stream: No such file or directory in /opt/lampp/htdocs/project/install.php on line 21
Warning: include(): Failed opening 'dbinfo.php' for inclusion (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/project/install.php on line 21
Notice: Undefined variable: host in /opt/lampp/htdocs/project/install.php on line 23
Notice: Undefined variable: user in /opt/lampp/htdocs/project/install.php on line 23
Notice: Undefined variable: password in /opt/lampp/htdocs/project/install.php on line 23
Notice: Undefined variable: database in /opt/lampp/htdocs/project/install.php on line 25
Notice: Undefined variable: database in /opt/lampp/htdocs/project/install.php on line 26
Error connecting to database.
我知道这些错误是由于权限被拒绝造成的。但我不知道如何解决这个问题。似乎该脚本没有编辑或创建数据库的权限。我是 Ubuntu 新手,无法解决这个问题。抱歉英语不好。