laravel 5.4 所需環境指令
主機環境:
安裝composer:
安裝laravel需要的套件:
apt-get update && apt-get install -y git
echo "* soft nofile 64000" >> /etc/security/limits.conf
echo "* hard nofile 64000" >> /etc/security/limits.conf
echo "root hard nofile 64000" >> /etc/security/limits.conf
echo "root hard nofile 64000" >> /etc/security/limits.conf
echo "session required pam_limits.so" >> /etc/pam.d/common-session
echo "session required pam_limits.so" >> /etc/pam.d/common-session-noninteractive
echo "ulimit -HSn 64000" >> /etc/profile
apt-get install -y imagemagick libmagickwand-dev libmagickcore-dev
add-apt-repository ppa:ondrej/php && apt-get update
apt-get install -y php5.6 \
php5.6-xml \
php5.6-dev \
php5.6-fpm \
php5.6-mysql \
php5.6-mbstring \
php5.6-curl \
php5.6-gd \
php-imagick \
php-redis \
php-memcache
apt-get install nginx
# 將php5.6-fpm內的設定修改 listen = 127.0.0.1:9000
vi /etc/php/5.6/fpm/pool.d/www.conf
sudo service php5.6-fpm restart
mkdir -p /var/log/nginx/
# 安裝 docker
curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh
service docker start
# 安裝 docker-compose
curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
mkdir -p /data/db
chown www-data:www-data -R 專案目錄
安裝composer:
php -r "readfile('https://getcomposer.org/installer');" > composer-setup.php
php composer-setup.php
php -r "unlink('composer-setup.php');"
mv composer.phar /usr/local/bin/composer
安裝laravel需要的套件:
rm -f composer.lock
composer install
chmod g+w -R public
chmod g+w -R storage
php artisan storage:link
留言
張貼留言