In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how nginx deploys php7 projects". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian and go deeper to study and learn "how nginx deploys php7 projects" together!
Nginx deployment php7 project methods: 1, install nginx and php7 through install;2, copy laravel project to the specified directory and modify the configuration document;3, restart nginx can be.
Operating environment: centos 7.4 system, PHP 7.0 version, Dell G3 computer.
How does nginx deploy php7 projects?
7 simple steps to build nginx+php7 environment and deploy laravel project
Build nginx+php7 environment laravel project deployment
0. preparations
1, host, mine is centos7.4
2. Write a laravel project
3. Update yum warehouse
[root@piehost ~]# yum install https://centos7.iuscommunity.org/ius-release.rpm -y
1. install Nginx
[root@piehost ~]# yum -y install nginx && systemctl start nginx && systemctl enable nginx
2. install the database
3. Install php7
[root@piehost ~]# yum install -y php70u-fpm && yum install php70u-gd php70u-mysqlnd php70u-pdo php70u-mcrypt php70u-mbstring php70u-json -y && systemctl start php-fpm && systemctl enable php-fpm
4. After setting up the environment, copy the laravel project to the specified directory and modify the configuration document
Assuming your laravel project is called mylaravel project, copy it to/root /soft/www
[root@piehost ~]# vim /etc/nginx/conf.d/mylaravelproject.conf //modify configuration file server {listen 80;server_name Your server IP address or domain name;root /soft/www/mylaravelproject/public;index index.php index.html;location / { try_files $uri $uri/ /index.php?$ query_string; client_max_body_size 1000m;}location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params;}
5. restart nginx
[root@piehost ~]# systemctl restart nginx
6. Go to your project directory to modify permissions
Modify permissions for these two folders: bootstrap storage
[root@piehost mylaravelproject]# chmod 777 -R bootstrap storage
7. Open port 80
[root@piehost mylaravelproject]# /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
You can now access your website from your address.
Thank you for reading, the above is the content of "how nginx deploys php7 project", after learning this article, I believe that everyone has a deeper understanding of how nginx deploys php7 project, and the specific use needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.