user3172479
user3172479

Reputation:

What command-line to use in Symfony2 framework in windows

I'm creating a website using Symfony2 framework but I can't get proceed to the creation of the website because I don't know where to type like these

$ php symfony configure:database "mysql:host=localhost;dbname=jobeet" root mYsEcret,

$ php symfony doctrine:build-schema.

It seems an Linux command and it doesn't work on windows command-prompt.

What commandLine should I used for this ?

Upvotes: 2

Views: 178

Answers (2)

Zeljko
Zeljko

Reputation: 5158

I would suggest you to use Easyphp, it has phpreg.exe (or something like that) that will put php in %PATH% variable. It also allows you to create virtual hosts from browser, and easyphp will take care of everything else.

Instead of Sublime, use Phpstorm. It has by far the best Symfony2 plugin of all editors. If you are still learning S2, you will definatelly need autocompletion for forms, services, doctrine... Just amazing!

Upvotes: -1

DARDAR SAAD
DARDAR SAAD

Reputation: 402

You need to add your PHP installation directory to the %PATH% environment variable, or work from the PHP installation directory.

To add it to path (The best approach - Edited for Windows 7):

  • Right-click on a My Computer icon
  • Click Properties
  • Click Advanced system settings from the left nav
  • Click Advanced tab
  • Click Environment Variables button
  • In the System Variables section, select Path (case-insensitive) and click Edit button
  • Add a semi-colon (;) to the end of the string, then add the full file system path of your PHP installation (e.g. C:\Program Files\PHP)
  • Keep clicking OK etc until all dialog boxes have disappeared
  • Close your command prompt and open it again
  • Sorted

Alternatively, you can run cd <PHP installation path> before you try and run you command, or call your script like <FULL file system path of php.exe> <path to script>

Then you open the CMD and you write the Symfony commands

Upvotes: 6

Related Questions