http://tecadmin.net/install-laravel-framework-on-ubuntu/http://tecadmin.net/install-laravel-
framework-on-ubuntu/
http://tecadmin.net/install-laravel-framework-on-ubuntu/
PHP, Php Frameworks 14 Comments
Laravel is an open source PHP framework, designed for the faster development of MVC web applications in PHP. This article will help you to configure Laravel PHP Framework on Ubuntu 15.04, 14.10, 14.04 LTS and 12.04 LTS Systems.
To start with Laravel, we first need to set up a running LAMP server. If you have already running LAMP stack skip this step else use followings commands to set up lamp on Ubuntu system.
$ sudo apt-get install python-software-properties $ sudo add-apt-repository ppa:ondrej/php5 $ sudo apt-get update $ sudo apt-get install -y php5 php5-mcrypt
$ apt-get install apache2 libapache2-mod-php5
$ apt-get install mysql-server php5-mysql
Composer is required for installing Laravel dependencies. So use below commands to download and use as a command in our system.
$ curl -sS https://getcomposer.org/installer | php $ sudo mv composer.phar /usr/local/bin/composer $ sudo chmod +x /usr/local/bin/composer
To download latest version of Laravel, Use below command to clone master repo of laravel from github.
$ cd /var/www $ git clone https://github.com/laravel/laravel.git
Navigate to Laravel code directory and use composer to install all dependencies required for Laravel framework.
$ cd /var/www/laravel $ sudo composer install
Dependencies installation will take some time. After than set proper permissions on files.
$ chown -R www-data.www-data /var/www/laravel $ chmod -R 755 /var/www/laravel $ chmod -R 777 /var/www/laravel/app/storage
Now add a Virtual Host in your Apache configuration file to access Laravel framework from web browser. Create Apache configuration file under /etc/apache2/sites-available/ directory and add below content.
$ vim /etc/apache2/sites-available/laravel.example.com.conf
<VirtualHost *:80> ServerName laravel.example.com DocumentRoot /var/www/laravel/public <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/laravel> AllowOverride All </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
Finally lets enable website and reload Apache service using below command.
$ a2ensite laravel.example.com (a2ensite 命令讲解:http://blog.csdn.net/hfahe/article/details/5490223) $ sudo service apache2 reload
And you have all done. Access http://laravel.example.com in your favorite web browser and start developing great applications.
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。