How to setup laravel framework in wampserver properly? How to setup laravel framework in wampserver properly? php php

How to setup laravel framework in wampserver properly?


Installing Laravel 4 on WAMP

1. Enable OpenSSL

OpenSSL must be enabled in the PHP configuration.

Edit php.ini in your WAMP’s PHP folder, e.g.:

C:\wamp\bin\php\{Your.PHP.Version}\

where {Your.PHP.Version} is something like php5.4.12.

Note:

You should not edit the php.ini inside

C:\wamp\bin\apache\{Your.Apache.Version}\bin

where {Your.Apache.Version} is something like Apache2.4.4, because that is not the file that Composer uses.

Find the following line and remove its preceding semicolon (if there is one) and save the file. So change

;extension=php_openssl.dll

to

extension=php_openssl.dll

2. Install Composer

Now we need to install Composer. This is a dependency manager that will download the latest release of Laravel and specific versions of Laravel’s dependencies, such as Doctrine and Symfony.

2.1. Download the Composer Windows installer from

https://getcomposer.org/download/

2.2. Run the installer.

2.3. When it asks for the location of php.exe, point it to the executable in your WAMP’s PHP folder, e.g.:

C:\wamp\bin\php\{Your.PHP.Version}\

2.4. Finish the installation.

2.5. Open a command-line interface (cmd) and type:

composer

It should return a list of options. If you get an error, restart your computer and try again.

Composer has now been installed and added to your PATH environment variable. This means you can run it from any directory using the command-line interface.

3.Install Laravel

Now that Composer has been installed, Composer can download and install Laravel on your system.

3.1. Open a command-line interface (cmd).

3.2. Go to the directory in which you want to install Laravel. This is usually your development directory. In this tutorial, we’ll use C:\wamp\www\laravel

3.3. Instruct Composer to install Laravel into a project directory. We use project name myproject.

composer create-project laravel/laravel myproject --prefer-dist

Note:

This will install Laravel in a subdirectory named myproject under current working directory.

Now your project has a running directory like

C:\wamp\www\laravel\myproject\public\

Please check as accepted answer and upvote.


I am using this procedure to set up laravel to wamp server and it work perfectly

1.you have to put laravel in  C:\wamp\www folder2.then u have to go application/config ....open application.php and change url='';3.change key='K3u4UsHKh7AjSitP9VLTMtbd1mjvdzmQ'4.then u have to go int C:\wamp\bin\apache\Apache2.2.21\conf\extra  folder then  open <<=== httpd-vhosts.conf ===>> file and paste below this line into that folder<VirtualHost *:80>    DocumentRoot C:/wamp/www/laravel/public    ServerName xxxxx.dev</VirtualHost>5.then go   C:\Windows\System32\drivers\etc  folder and open <<=== hosts ===>> file then paste 127.0.0.1       xxxxx.dev6.then go C:\wamp\www\laravel\public folder ...and then open a.htaccess ..then paste Options +FollowSymLinksRewriteEngine onRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . index.php [L]7.Then u have to go >> C:\wamp\bin\apache\apache2.2.22\conf <<  this directory & open httpd.conf & comment out this line# Virtual hostsInclude conf/extra/httpd-vhosts.conf8.then go wamp server .....start it ..and click rewrite mode in apache->apache module..then restart wamp server9.then go ur browser and write xxxxx.dev/docs  ...

I hope this helps you!


You will need to enable openssl and curl in php to run composer properly you must do this in both the apache bin and the php bin in wamp. Apache uses it's own php.ini when WAMP server is running, however anytime you run PHP from the command line it runs using the wamp/bin/php version so edit both these files to ensure it runs properly:/wamp/bin/apache/ApacheX.X.X/bin/php.ini and /wamp/bin/php/phpX.X.X/php.ini

look for extension=php_openssl.dll ~line 970 and extension=php_curl.dll ~line 952

After that is done you should set up a virtualhost by following these steps: http://www.kristengrote.com/blog/articles/how-to-set-up-virtual-hosts-using-wamp

In new versions of WAMP you can copy the vhosts.conf into the wamp/vhosts dir to create separate vhosts file for each vhost you set up.

Make sure you point the documentroot to your /public dir of where your laravel project will be (it does not need to be in wamp/www it can be installed in wamp/myproject if you want so long as the webroot points to wamp/myproject/public.

It's best to download the windows installer and install composer globally. Once it is installed simply use Laravel's quick install method by typing composer create-project laravel/laravel your-project-name --prefer-dist

If you are running PHP 5.4 in your wamp stack you can simply use the CLI to go to the root of your laravel install and type php artisan serve which will fire up PHP's built in webserver on port 8000. You can access your laravel project by going to localhost:8000 or fire up wamp and visit the vhost domain you setup in the steps above.

If all goes well you should get the "You have arrived!" welcome screen.