1、composer安装
打开composer官网。根据提示linux下可以使用php安装。
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"php -r "if (hash_file('SHA384', 'composer-setup.php') === 'c32408bcd017c577ce80605420e5987ce947a5609e8443dd72cd3867cc3a0cf442e5bf4edddbcbe72246a953a6c48e21') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"php composer-setup.phpphp -r "unlink('composer-setup.php');"
安装好后,配置composer全局。
mv composer.phar /usr/local/bin/composer
配置composer中国镜像
composer config -g repo.packagist composer https://packagist.phpcomposer.com
安装laravel
composer create-project laravel/laravel laravel
结果出现如下错误,
[Symfony\Component\Process\Exception\RuntimeException]
The Process class relies on proc_open, which is not available on your PHP installation.在php.ini 中找到disable_function 将proc_open删掉,保存。
安装成功。