系统相关
首页 > 系统相关> > 为什么我无法在Ubuntu 16.04上安装PHP

为什么我无法在Ubuntu 16.04上安装PHP

作者:互联网

我一直试图在ubuntu 16.04上安装laravel 3天.我正在关注laravel安装过程的顶部搜索链接.但是我无法执行我尝试过的每个过程.现在,我在ubuntu上安装PHP时遇到了另一个问题.我曾经安装过maria db,但没有成功.
但是它可能损坏了某些东西,导致我无法安装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完全陌生.如果有人指导我如何在ubuntu 16.04上安装laravel,我将不胜感激.
谢谢.

解决方法:

>安装git apt-get安装git-core
> git clone https://github.com/thamaraiselvam/LEMP-Stack-Installer.git
> cd quick-lemp-install或cd LEMP-Stack-Installer
> chmod x lemp.sh该命令使bash脚本可执行
> ./lemp.sh
而已 :)

PHP version – v7.0

Mysql version – Latest Stable

Note: Default mysql password is root. you can change it before running
in the following lines before running the script

sudo debconf-set-selections <<< ‘mysql-server
mysql-server/root_password password YOUR_PASSWORD’

sudo debconf-set-selections <<< ‘mysql-server
mysql-server/root_password_again password YOUR_PASSWORD’

现在安装Laravel

>转到cd / var / www / html /
> sudo apt-get install php-common php-mbstring php-xml php-zip
>作曲者create-project –prefer-dist laravel / laravel博客“ 5.5.*”

标签:laravel,ubuntu-16-04,mysql,php
来源: https://codeday.me/bug/20191108/2009088.html