PEAR installation
PEAR is a framework and distribution system for reusable PHP components.
0. Start WAMP
1. Download PEAR at http://pear.php.net/go-pear.phar
The phar extension provides a way to put entire PHP applications into a single file called a “phar” (PHP Archive) for easy distribution and installation.
2. Copy go-pear.phar into C:\wamp64\bin\php\php5.6.25
3. On Win Button type cmd.exe, RMB ‘Run as Administrator’ and navigate to C:\wamp64\bin\php\php5.6.25
4. Input in the command window: php go-pear.phar
– Are you installing a system-wide PEAR or a local copy?: leave default (system:loca) [system]
– Below is suggested file layout… (locazioni proposte per l’installazione): ENTER to go on
– Would you like to later php.ini?: Y (includerà il path per il pear)
– Enter to continue: ENTER
5. C:\wamp64\bin\php\php5.6.25 double click Pear_ENV.reg (aggiunta al registro di sistema)
PEAR is installed
Nota: per vedere il registo di sistema cliccare sul bottone di windows, in cerca programmi e file scrivere ‘regedit’
Environment variables
1. Bottone di Windows> RMB Computer> Proprietà> Impostazioni di sistema avanzate> Avanzate> Variabili d’ambiente> Variabili di sistema> Variabile Path> Modifica…>aggiungere il separatore ; e C:\wamp64\bin\php\php5.6.25
Symfony 1.4
1. On Win Button type cmd.exe, RMB ‘Run as Administrator’ and navigate to C:\wamp64\bin\php\php5.6.25
2. Type the command: pear channel-discover pear.symfony-project.com (aggiunge a PEAR il canale di Symfony)
3. Type the command: pear install symfony/symfony (scarica symfony-1.4.20.tgz)
At the end you will have the message install ok: …
4. Type: C:\wamp64\bin\php\php5.6.25\symfony -V (message: symfony version 1.4.20), l’installazione è verificata
NB: il comando symfony -V è visto da tutte le cartelle perchè il percorso è registrato
Project Creation
0. We want to create a project named ‘jobeet’
1. Create the folder c:\wamp64\www\jobeet
NB: Windows users are advised to run symfony and to setup their new project in a path which contains no spaces
2. Inside \jobeet folder run the command:
cmd.exe -> c:\wamp64\www\jobeet\symfony generate:project jobeet –orm=Propel
Symfony will create the folder structure:
apps/ Hosts all project applications -> al momento è vuota
cache/ The files cached by the framework
config/ The project configuration files
lib/ The project libraries and classes
log/ The framework log files
plugins/ The installed plugins
test/ The unit and functional test files
web/ The web root directory
NB: The generate:project task has also created a symfony shortcut in the project root directory to shorten the number of characters you have to write when running a task.
App Creation
1. Copy C:\wamp64\bin\php\symfony.bat to c:\wamp64\www\jobeet\
2. cmd.exe -> c:\wamp64\www\jobeet\symfony generate:app frontend
Symfony will create the folder structure:
apps/config
apps/i18n
apps/lib -> libraries
apps/modules -> code MVC
apps/templates
3. Set the write permission for jobeet\cache – jobeet\log – chmod 777, permit read,write,execute
RMB sulla cartella cache> Proprietà> Condivisione> Condivisione avanzata> Condividi la cartella> Autorizzazioni> Consenti> attivare Controllo completo, Modifia, Lettura
RMB sulla cartella log> Proprietà> Condivisione> Condivisione avanzata> Condividi la cartella> Autorizzazioni> Consenti> attivare Controllo completo, Modifia, Lettura
4. Set Apache
LMB over WAMP Icon> Apache> httpd.conf
Copy and paste in the end:
# -------------------------------------------------------------------------------
# Project jobeet START
# Be sure to only have this line once in your configuration
NameVirtualHost 127.0.0.1:8080
# This is the configuration for your project
Listen 127.0.0.1:8080
# 127.0.0.1:8080 da browser punta a c:\wamp64\www\jobeet\web
<VirtualHost 127.0.0.1:8080>
DocumentRoot "c:\wamp64\www\jobeet\web"
DirectoryIndex index.php
<Directory "c:\wamp64\www\jobeet\web">
AllowOverride All
Allow from All
</Directory>
Alias /sf "c:\wamp64\www\jobeet\lib\vendor\symfony\data\web\sf"
<Directory "c:\wamp64\www\jobeet\lib\vendor\symfony\data\web\sf">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
# Project jobeet END
# -------------------------------------------------------------------------------
NB: The /sf alias gives you access to images and javascript files needed to properly display default symfony pages and the web debug toolbar|Web Debug Toolbar.
LMB over WAMP Icon> Restart All services
5. Open the browser and point it at: 127.0.0.1:8080 or at http://localhost/jobeet/web/index.php
If you do not see images you have to correct the code addet in httpd.conf.
Reference:
http://symfony.blog.gogo.mn/read/entry350425
https://blog.rolandl.fr/59-installer-symfony-1-4-avec-pear
http://symfony.com/legacy
http://symfony.com/legacy/doc