To work with Symfony, many people recommend to install every thing as a separate entity; PHP, Apache and MySQL. But sometimes the reality is different and you just need to use what you need to use. That was my case. I had WAMP Server 2.4 working for WordPress and I neded to install a Symfony 2.4 project, no option. So I decided to just meet the Symfony dependencies and install it. Then I created a cert of manual or how to? to help to guide others that might have the same problem. Also you might want to do it because of some other reason, but that was my reason. I was requested to do it like that and only like that. And in my country we have a saying that teaches something like this. If someone wants something even if it is a bad thing; don’t give him other thing. Of course I do not mean that WAMP or Symfony together are a bad thing. This is what I have done:
Software to install:
- WAMP Server 2.4.
- Symfony Requirements
- Symfony 2.4
Note: this post is about installing Symfony in windows with wamp if you work with Linux you can use this material. and if what you want is to move an app from development to a production environment, you need to do this.
1- Install WAMP server 32 bits.
Get wamp from here. Because of some incompatibilities with some versions of cache accelerators for php 5.4 64 bits it’s preferable to install the WAMP server 32 bits version. I have had problems to make the 64 bits work, but I can not 100% confirm it was because of incompatibility. I have installed wamp 32 bits latest version in: D:\Web\wamp. You can install it where ever you want, even the default path is a nice place for most people.
Before installing wamp you need to make sure you have installed Microsoft Visual C++ 2010 Redistributable, if you do not have it you can get the the version for 32 bits Windows from here, and for 64 bits from here.
The installation process goes straight forward normally is a next-next matter. Once you are done you can start the service straight away and test it by writing in your browser address bar:
Check out the picture.
2- PHP ssl module working
we need to install Composer the tool recommended and that we will use to download Symfony from the prompt. Composer recommends to have the php ssl module working. To do that we need to edit the php.ini for cli as when you enter commands in the prompt the system does not run the commands through Apache, so is the cli php.ini the one we need to edit. So edit the php.ini in Your\installation\path\php\php5.4.12\php.ini (the php version might change depending on the version of WAMP). On the file go to the extensions section and remove the ; from the extension for ssl.
This let’s composer run secure PHP connections from the prompt.
3- Instal composer.
4- Environment variables.
Activate environment variable for PHP, MySQL and Composer once you install it. add to the environment variable called PATH the path to your PHP, MySQL and Composer.
To edit the system
PATH environment variable:
- Right-click on
My Computer/Computerand select
- Select the
Advanced system settingstab in the
advanceddialog that appears
- Click on the
Editand add your directories containing the binaries separated by ; mine looks like this:
C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Java\jre7;C:\Program Files\Intel\iCLS Client\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64rogram Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64:\eSuppo৪睗孔\蚰ȯer\Software\MEI\Intel\[AxP][X750JA_X750JB]_Intel(R)_Management_Engine_Components\Vista32_Vista64_Win8_32_Win8_64_18.104.22.1687\Drivers\MEI\HECIᬀ嬱哈ȱ㵸\lags 20 -keypath “Software\Intel\Difx64”;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;D:\Web\wamp\bin\php\php5.4.16;C:\ProgramData\ComposerSetup\bin;D:\Web\wamp\bin\mysql\mysql5.6.12\bin5-
The last part of this I what I have added, but every case might be different depending on your own path to the binary files:
If you look closer there is a ; between every path that I specify. And the path is just the route to the executable files of the software that you want to be declared in your environment.
Note: Wamp’s php comes with a xdebugger version (a symfony requirement) so it does not need to be installed.just edit the nesting level. to do that update Apache’s php.ini and set the xdebug.max_nesting_level to 250:
zend_extension = "D:/Web/wamp/bin/php/php5.4.
[xdebug] xdebug.remote_enable = off xdebug.profiler_enable = off xdebug.profiler_enable_trigger = off xdebug.profiler_output_name = cachegrind.out.%t.%p xdebug.profiler_output_dir = "D:/Web/wamp/tmp" xdebug.max_nesting_level = 250
In normal conditions you will only have to add the last line.
5- Install a cache manager extension.
Normally you can install APC (http://dev.freshsite.pl/php-accelerators/apc/file/details/apc-3114-beta-for-php-54-win72008.html) or Opcache (http://dev.freshsite.pl/nc/php-accelerators/zend-opcache). I have decided to install APC if you have any newer PHP version 5 or newer Opcache is recommended as the default PHP acelerator even incorporated in the default installation.
To install APC, first copy the file to the extension_dir (you can find it in your php.ini).
Then add the following to the php.ini file.
where php_apc_3114_beta_php54_win7-2008.dll is the name of the apc dll downloaded from the URL, and it´s copied in the folder php/ext as I mentioned before.
If you want Symfony to use Opcache for this version of PHP, it should be something like this in you php.ini file.
;Opcache Extension for symfony zend_extension = "D:\Web\wamp\bin\php\php5.4.12\zend_ext\php_opcache_703_php54_vc9.dll" [opcache] opcache.enable = 1 opcache.memory_consumption = 300 opcache.interned_strings_buffer = 8 opcache.max_accelerated_files = 8000 opcache.fast_shutdown = 1 opcache.enable_cli = 1 opcache.use_cwd = 1
Taken from: https://coderwall.com/p/0sadqa
As we also have Xdebugger by default in WAMP we need to put the configuration before the xdebugger configuration in order for it to work otherwise it will not load.
Taken from: http://www.php.net/manual/en/opcache.installation.php
6- Activate other PHP modules
I recommend these if they are not already active to be active in yout php.ini:
extension=php_intl.dll extension=php_mbstring.dll extension=php_pdo_mysql.dll
But also you might need some other like:
extension=php_curl.dll extension=php_pdo_sqlite.dll extension=php_fileinfo.dll
7- download and deploy de Symfony framework.
-Open a command prompt and load the path to the install files, normally something like c:/wamp/www/project or in my case D:\Web\wamp\www\combi.
-Open your command prompt (CMDor any other you prefer) and load the folder where you have installed. Have the forder for your project to do that you can use the commands cd, mkdir, etc.
-Execute the command:
composer create-project symfony/framework-standard-edition path/ 2.4.2
Taken from: http://symfony.com/download
Note: If you are behind a proxy server you have to set and environment variable to say who is the proxy and how to authenticate. open a terminal and write something like this:
SET HTTP_PROXY=http://username:[email protected]:8080
SET HTTPS_PROXY=http://username:[email protected]:8080
Remember to change the parameter to fit in your network. username, password,proxy server name and domain or IP and the proxy port.
And that is it. We are done after the download is finished you can check that every thing is working. To do that put the following in the browser or at least something similar:
Under normal circumstances if everything went well you should get something like the picture, otherwise, review the step corresponding to the problem.