为什么我不能在ubuntu 16.04上安装php

rjjhvcjd  于 2021-06-20  发布在  Mysql
关注(0)|答案(2)|浏览(377)

我已经试着在ubuntu16.04上安装laravel三天了。我下面的拉威尔安装过程的顶部搜索链接。但我没能执行我尝试过的每一个过程。现在,在我的ubuntu上安装php时,我面临着一个不同的问题。我曾经安装过mariadb,但没有成功。但它可能破坏了某些东西,导致我无法安装php。我面临的问题是:

Reading package lists... Done 
Building dependency tree       
Reading state information... Done
php is already the newest version (1:7.2+62+ubuntu16.04.1+deb.sury.org+3).
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
mysql-server : Depends: mysql-server-5.7 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

当我尝试的时候 php -v 它给了我这个错误

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20170718/mcrypt.so' (tried: /usr/lib/php/20170718/mcrypt.so (/usr/lib/php/20170718/mcrypt.so: cannot open shared object file: No such file or directory), /usr/lib/php/20170718//usr/lib/php/20170718/mcrypt.so.so (/usr/lib/php/20170718//usr/lib/php/20170718/mcrypt.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP 7.2.9-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Aug 19 2018 07:16:12) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.9-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

我对ubuntu和laravel完全陌生。如果有人指导我如何在ubuntu16.04上安装laravel,我将非常感激。谢谢您。

kpbpu008

kpbpu0081#

尝试执行以下命令来解决问题:
通过执行以下命令获取系统上安装的mysql包的列表 sudo dpkg -l | grep mysql 通过执行以下命令删除上面显示的包 sudo apt-get --purge autoremove <packages from the step 1> 删除 /var/lib/mysql 尝试安装 mysql 再一次。它应该能解决你的问题

mrphzbgm

mrphzbgm2#

安装git apt-get install git-core git clone https://github.com/thamaraiselvam/LEMP-Stack-Installer.git cd quick-lemp-install 或cd lemp堆栈安装程序 chmod +x lemp.sh 此命令使bash脚本可执行 ./lemp.sh 就这样:)
php版本-v7.0
mysql版本-最新稳定
注意:默认mysql密码是root。在运行脚本之前,可以在以下行中更改它
sudo debconf set selections<<<'mysql server mysql server/root\u password密码您的\u密码'
sudo debconf set selections<<<'mysql server mysql server/root\u password\u再次输入您的密码'
现在安装laravel
cd /var/www/html/ sudo apt-get install php-common php-mbstring php-xml php-zip composer create-project --prefer-dist laravel/laravel blog "5.5.*"

相关问题