In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to install PHP framework Laravel on CentOS7 or Ubuntu15.04". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to install PHP framework Laravel on CentOS7 or Ubuntu15.04".
Laravel installation is not cumbersome, you can install it on CentOS 7 or Ubuntu 15 servers as long as you follow this article step by step.
1. Server requirement
Before installing Laravel, you need to install some of its dependency prerequisites, mainly some basic parameter adjustments, such as upgrading the system to the * * version, sudo permissions, and installing dependency packages.
When you connect to your server, make sure that you can successfully use the EPEL repository and upgrade your server with the following command.
CentOS 7
# yum install epel-release # rpm-Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm # rpm-Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm # yum update
Ubuntu
# apt-get install python-software-properties # add-apt-repository ppa:ondrej/php5 # apt-get update # apt-get install-y php5 mcrypt php5-mcrypt php5-gd
two。 Firewall installation
System firewall and SELinux settings are very important for product application security. When you use the test server, you can turn off the firewall and set SELinux into tolerant mode permissive with the following command line to ensure that the installer is not affected by them.
# setenforce 0
3.Apache, MariaDB, PHP installation
The Laravel installer needs to complete the installation of the entire LAMP environment and requires additional installation of PHP extensions such as OpenSSL, PDO,Mbstring, and Tokenizer. If LAMP is already running on your server, you can skip this step and directly confirm that some of the necessary PHP plug-ins are installed.
To install the full AMP, you need to run the following command on your own server.
CentOS
# yum install httpd mariadb-server php56w php56w-mysql php56w-mcrypt php56w-dom php56w-mbstring
To enable MySQL / Mariadb services to boot automatically on CentOS 7, you need to run the following command.
# systemctl start httpd # systemctl enable httpd # systemctl start mysqld # systemctl enable mysqld
After starting the MariaDB service, you need to run the following command to configure a sufficiently secure password.
# mysql_secure_installation
Ubuntu
# apt-get install mysql-server apache2 libapache2-mod-php5 php5-mysql
4. Install Composer
Before we install Laravel, let's start installing composer. Installing composer is one of the most important steps in installing Laravel, because composer can help us install various dependencies of Laravel.
CentOS/Ubuntu
Run the following command under CentOS / Ubuntu to configure composer.
# curl-sS https://getcomposer.org/installer | php # mv composer.phar / usr/local/bin/composer # chmod + x / usr/local/bin/composer
Composer installation
5. Install Laravel
We can run the following command to download the Laravel installation package from github.
# wget https://github.com/laravel/laravel/archive/develop.zip
Run the following command to extract the installation package and move the root directory of document.
# unzip develop.zip # mv laravel-develop / var/www/
Now use the compose command to install all the dependencies required by Laravel in the directory.
# cd / var/www/laravel-develop/ # composer install
Compose laravel
6. Secret key
To encrypt the server, we use the following command to generate an encrypted 32-bit key.
# php artisan key:generate Application key [Lf54qK56s3qDh0ywgf9JdRxO2N0oV9qI] set successfully
Now put the key in the 'app.php' file, as shown below.
# vim / var/www/laravel-develop/config/app.php
Key encryption
7. Virtual host and its user
After composer is installed, assign permissions and users to the document root directory, as shown below.
# chmod 775 / var/www/laravel-develop/app/storage # chown-R apache:apache / var/www/laravel-develop
Open the default configuration file for the apache server with any editor and add the virtual host configuration to the file *.
# vim / etc/httpd/conf/httpd.confServerName laravel-develop DocumentRoot / var/www/laravel/public start Directory / var/www/laravel AllowOverride All Directory close
Now let's restart the apache server with the following command and open a browser to view the localhost page.
CentOS
# systemctl restart httpd
Ubuntu
# service apache2 restart
8.Laravel 5 Network access
Open the browser and enter your configured IP address or the full domain name Fully qualified domain name and you will see the default page of Laravel 5.
Laravel Default
Thank you for reading, the above is the content of "how to install PHP framework Laravel on CentOS7 or Ubuntu15.04". After the study of this article, I believe you have a deeper understanding of how to install PHP framework Laravel on CentOS7 or Ubuntu15.04, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.