您好,登錄后才能下訂單哦!
這篇文章主要介紹docker如何安裝Laravel環境,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!
Laravel 是一套簡潔、優雅的PHP Web開發框架。它可以讓你從面條一樣雜亂的代碼中解脫出來;它可以幫你構建一個完美的網絡APP,而且每行代碼都可以簡潔、富于表達力。
docker network create --subnet=172.18.0.0/16 mynetwork
docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root --net mynetwork --ip 172.18.0.2 --name mariadb mariadb:latest
docker run -d -p 6379:6379 --net mynetwork --ip 172.18.0.3 --name redis redis
mysql -h227.0.0.1 -uroot -proot
docker run -itd --privileged --net mynetwork --ip 172.18.0.3 -v /Users/vckin/Desktop/vckin/app/code:/var/www -v /Users/vckin/Desktop/vckin/nginx:/etc/nginx/conf.d -p 80:80 -p 443:443 --name nginx-php73 centos:latest /usr/sbin/init
yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm yum -y install yum-utils yum-config-manager --enable remi-php74 yum update yum install php php-cli yum install php-fpm php-cli php-bcmath php-gd php-json php-mbstring php-mcrypt php-mysqlnd php-opcache php-pdo php-pecl-crypto php-pecl-mcrypt php-pecl-geoip php-recode php-snmp php-soap php-xmll php-php-dom php-zip php-process php-redis systemctl start php-fpm
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" php composer-setup.php php -r "unlink('composer-setup.php');" mv composer.phar /usr/local/bin/composer
yum install nginx -y systemctl start nginx
server { #偵聽80端口 listen 80; index index.php index.html index.htm; #設定本虛擬主機的訪問日志 server_name localhost; root /var/www/public; #rewrite_log on; #access_log logs/hc-admin.access.log main; #error_log logs/hc-admin.access.log main; location ~ .*\.(gif|jpg|jpeg|bmp|png|ico|txt|js|css|ttf|woff|woff2)$ { root /var/www/public; } location / { index index.htm index.html index.php; if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; break; } } location ~ \.php/?.*$ { root /var/www/public; #此處為docker Gateway ip fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; #加載Nginx默認"服務器環境變量"配置 #include fastcgi.conf; include fastcgi_params; set $fastcgi_script_name2 $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+\.php)(/.+)$") { set $fastcgi_script_name2 $1; set $path_info $2; } fastcgi_param PATH_INFO $path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name2; fastcgi_param SCRIPT_NAME $fastcgi_script_name2; } }
phpinfo();
以上是“docker如何安裝Laravel環境”這篇文章的所有內容,感謝各位的閱讀!希望分享的內容對大家有幫助,更多相關知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。