Laravel Study Notes (3) -- configure laravel on centos

Source: Internet
Author: User
Tags php mysql php source code php website

After several days of development in the laravel framework, I have to say that it is indeed more elegant and the handling logic is clearer.

Today, I plan to configure a laravel on centos 7, which was previously developed on the local machine. I plan to configure it. 1) Apache, PHP, and MySQL have been installed on the system. The installation command is yum install httpd PHP MySQL because there are few PHP modules that come with centos 7. To add modules, You need to compile them, therefore, you need the PHP-devel module and use the yum install PHP-devel command. 2) install laravel a) install composer: curl-SS https://getcomposer.org/installer | php mv composer. phar/usr/local/bin/Composer B) install laravel composer global require "laravel/Installer = ~ 1.1 "this command will be in ~ /. Install a laravel command under composer/vender/bin. You can put this directory in the system path or directly execute mkdir/opt/www cd/opt/WWW ~ /. Composer/vender/bin/laravel new study creates a study directory that contains the complete files required for laravel development. C) Configure Apache and set/opt/www/study/public to the Home Directory of the website. Modify/etc/httpd/CONF/httpd, the following content of conf is DocumentRoot "/opt/www/Kangfu/Public" <directory "/opt/www/Kangfu/pubic">
Options indexes followsymlinks
AllowOverride all
Require all granted
</Directory> you can modify the main directory and replace it with/opt/www/study/public. Then you can enter http: // ip_addr/in the browser /, the system will prompt that the PHP-mcrypt module is not available, which is troublesome. 3) install PHP-mcrypt installation process can refer to the basic process of the http://www.cnblogs.com/ccdc/archive/2013/04/19/3030156.html is to download libmcrypt, mhash, mcrypt installation package, in turn to compile and install, usually commands in turn. /configure make install when mcrypt is configured, the system will prompt that libmcrypt cannot be found. so, you need to add the path to LD_LIBRARY_PATH. The command is export LD_LIBRARY_PATH =/user/local/LIB; LD_LIBRARY_PATH and then configure and install it. For PHP-mcrypt, You need to download the PHP source code. The local version is 5.4.16. download it from the PHP website, decompress it, go to the PHP Directory, and then go to ext/mcrypt, run phpize # To generate the config file. If PHP-devel is not installed, an error occurs.
    ./configure --with-php-config=/usr/bin/php-config
     make
     make install
Run echo 'extension = mcrypt. so'> mcrypt. ini under/etc/httpd/CONF. d /.
Enter http: // ip_addr/in the browser to view the startup page.
In fact, this process is very simple, but I have learned something about the methods for adding modules to PhP. Laravel Study Notes (3) -- configure laravel on centos

Laravel Study Notes (3) -- configure laravel on centos

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.