How To Install Laravel 4 Framework on Ubuntu
http://tecadmin.net/install-laravel-framework-on-ubuntu/http://tecadmin.net/install-laravel-
framework-on-ubuntu/
http://tecadmin.net/install-laravel-framework-on-ubuntu/
Written by Rahul
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.
Step 1: Install LAMPTo 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.
Install PHP 5.5$sudoapt-getinstallpython-software-properties$sudoadd-apt-repositoryppa:ondrej/php5$sudoapt-getupdate$sudoapt-getinstall-yphp5php5-mcryptInstall Apache
$apt-getinstallapache2libapache2-mod-php5Install MySQL
$apt-getinstallmysql-serverphp5-mysqlStep 2: Install Composer
Composer is required for installing Laravel dependencies. So use below commands to download and use as a command in our system.
$curl-sShttps://getcomposer.org/installer|php$sudomvcomposer.phar/usr/local/bin/composer$sudochmod+x/usr/local/bin/composerStep 3: Install Laravel
To download latest version of Laravel, Use below command to clone master repo of laravel from github.
$cd/var/www$gitclonehttps://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$sudocomposerinstall
Dependencies installation will take some time. After than set proper permissions on files.
$chown-Rwww-data.www-data/var/www/laravel$chmod-R755/var/www/laravel$chmod-R777/var/www/laravel/app/storageStep 4: Create Apache VirtualHost
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>ServerNamelaravel.example.comDocumentRoot/var/www/laravel/public<Directory/>OptionsFollowSymLinksAllowOverrideNone</Directory><Directory/var/www/laravel>AllowOverrideAll</Directory>ErrorLog${APACHE_LOG_DIR}/error.logLogLevelwarnCustomLog${APACHE_LOG_DIR}/access.logcombined</VirtualHost>
Finally lets enable website and reload Apache service using below command.
$a2ensitelaravel.example.com(a2ensite命令讲解:http://blog.csdn.net/hfahe/article/details/5490223)$sudoserviceapache2reload
And you have all done. Access http://laravel.example.com in your favorite web browser and start developing great applications.
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。