Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup laravel framework in wampserver properly?

Tags:

php

laravel

I am studying laravel now. But I am having a difficulty in installing the framework in my wampserver. I followed this instruction but I am getting an error.

Via Download

Once Composer is installed, download the latest version of the Laravel framework and extract its contents into a directory on your server. Next, in the root of your Laravel application, run the php composer.phar install (or composer install) command to install all of the framework's dependencies. This process requires Git to be installed on the server to successfully complete the installation.

If you want to update the Laravel framework, you may issue the php composer.phar update command.

But what I did is I extracted the laravel-master file in my www folder then I also put the composer.phar inside the laravel-master folder.

So I have a directory like this.

C:/wamp/www/laravel-master/

Here's my structure

- wamp   - www     - laravel       - app (folder)       - boostrap (folder)       - public (folder)       - .gitattributes       - .gitignore       - artisan       - composer.json        - composer.phar       - CONTRIBUTING.md       - phpunit.xml       - readme.md       - server.php       - upgrade.md 

And in my command prompy I install the composer.phar by this way:

C:\wamp\www\laravel>php composer.phar install 

But here's my error

Installing dependencies Your requirements could not be solved to an installable set of packages.

Problems:         - The requested package "laravel/framework" with constraint [> 4.0.9999999.9999999, < 4.1.9999999.9999999] could not be found.         - Problem caused by:                 - Installation of package "laravel/laravel" with constraint == 1.0.0.0 was requested. Satisfiable by packages [laravel/laravel-1.0.0.0].                 - Package "laravel/laravel-1.0.0.0" contains the rule laravel/laravel requires laravel/framework ([> 4.0.9999999.9999999, < 4.1.9999999.9999999]). No package satisfies this dependency. 

I also tried to install it using composer but I have an error too.

C:\wamp\www\laravel>composer create-project laravel/laravel --prefer-dist Installing laravel/laravel (v4.1.0)   - Installing laravel/laravel (v4.1.0)      [RuntimeException]   You must enable the openssl extension to download files via https    create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repository-url="..."] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [package] [directory] [version] 

When I checked the ssl in my apache and PHP it is enable. And also I check it using the phpinfo()

Please help me guys. What should I do?

like image 214
Jerielle Avatar asked Jan 07 '14 23:01

Jerielle


People also ask

Can Laravel work with Wamp?

Laravel is no doubt the most popular PHP framework. It allows you to create web applications fast and easy. In this, I'm going to show you how to create your first Laravel app that runs on your local wamp server. Before getting started, make sure the composer is installed in your system.

What is the best way to install Laravel?

Via Download. Once Composer is installed, download the 4.2 version of the Laravel framework and extract its contents into a directory on your server. Next, in the root of your Laravel application, run the php composer. phar install (or composer install ) command to install all of the framework's dependencies.


2 Answers

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.

like image 162
Ravi Delixan Avatar answered Sep 19 '22 14:09

Ravi Delixan


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 folder  2.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.dev  6.then go C:\wamp\www\laravel\public folder ...and then open a.htaccess ..then paste  Options +FollowSymLinks RewriteEngine on  RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d  RewriteRule . 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 hosts Include conf/extra/httpd-vhosts.conf  8.then go wamp server .....start it ..and click rewrite mode in apache->apache module..then restart wamp server  9.then go ur browser and write xxxxx.dev/docs  ... 

I hope this helps you!

like image 20
Ferrakkem Bhuiyan Avatar answered Sep 18 '22 14:09

Ferrakkem Bhuiyan