Linux安装laravel5 遇到的问题

1,安装laravel5 时需要先安装composer 。当安装这个的时候

php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"

  

复制

php composer-setup.php

  

复制

php -r "unlink('composer-setup.php');"

  

遇到一个问题,就是

接着就出现查了各种资料,发现可以重新编译一下php7

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php --enable-mbstring --enable-ftp --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --without-pear --enable-sockets --with-freetype-dir=/usr --with-zlib --with-libxml-dir=/usr --with-xmlrpc --enable-zip --enable-fpm --enable-xml --enable-sockets --with-gd --with-zlib --with-iconv --enable-zip --with-freetype-dir=/usr/lib/ --enable-soap --enable-pcntl --enable-cli --with-curl --with-apxs2=/usr/sbin/apxs

  

老的多一个红框导致的问题

 

 

摘要:
今天在linux下尝试安装composer时报了这个问题

 

 

查了好几个小时都没查到怎么安装这个拓展,最后只能转另一种思路了(重新编译php的时候把它删了!!)
先看一下自己的phpinfo的Configure Command 应该是有–disable-phar这个字眼的,就是这个引起的报错

 

 

 

解决办法:
1.进如php安装目录,重新执行

 cd /usr/local/src/php-7.1.31/

1
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php --enable-mbstring --enable-ftp --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --without-pear --enable-sockets --with-freetype-dir=/usr --with-zlib --with-libxml-dir=/usr --with-xmlrpc --enable-zip --enable-fpm --enable-xml --enable-sockets --with-gd --with-zlib --with-iconv --enable-zip --with-freetype-dir=/usr/lib/ --enable-soap --enable-pcntl --enable-cli --with-curl

1
make && make install

  

2.再重新启动下php 即可发现已经没有了phar

 

 

3.再重新安装composer

 

 

遇到镜像特别慢的问题:
 
全局配置(推荐)
 
composer config -l -g
//切换到国内源  阿里
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
composer config -g --unset repos.packagist
 


composer create-project laravel/laravel learnlaravel5

  

 

 

posted @ 2021-01-22 10:59  pebblecome  阅读(87)  评论(0)    收藏  举报