Add symfony console to PhpStorm - php

I'm trying to add the symfony2 console to phpStorm (v10.0.3) but I'm getting an error like this:
But it's working in the console
Symfony console is correct and php path is too, because I can create bundle like "php app\console generate:bundle"
Anyone know why PhpStorm is returning error?

Try defining the parameters properly.
Path to Symfony -> path to 'app/console'
Path to PHP executable -> click dropdown and select the proper PHP executable location (full path to the executable PHP - in your case php.exe). If you are not sure then type where php.exe to get the exact location of the exe file.
Symfony component version -> Select your Symfony version (version 2.x or 3.x)
Hope this helps.

Related

phalcon installed components or not coming in cmd windows opertaing system

I have installed the phalcon in windows by adding phalcon_dll to xampp/php/ext and added extension in php.ini file now when i checked whether it installed or not i did <?php phpinfo(); ?> then i can able to see that it is installed..
Now i want to create a new skelton application through cmd when i type phalcon it should show the components as per documentation but its sayin this:
C:\Users\Amerytrech-Waheed>phalcon
'phalcon' is not recognized as an internal or external command,
operable program or batch file.
im tryig do like this: https://www.tutorialspoint.com/phalcon/phalcon_environmental_setup.htm
but little confused what are all need to add in system variables.?
and what is the alternate solution to create skelton?
Step 5 in the very document you pasted states:
After downloading the package, set the path variable in the system properties
it then explicitly shows you an image that shows the path to add, separated by a semicolon.
;C:\phalcon-devtools-master
So if you are unclear on where to set this.
Right click Computer -> Properties -> Advanced -> Environment Variables -> Path then add the path mentioned above to the very end of the path string.

Can't get Symfony 2 to work with PHPstorm

I've installed the symfony plugin to PHPstorm, but when I'm trying to run the project I get the following error
Fatal error: Class 'Doctrine\Tests\Common\Cache\CacheTest' not found in ...
I've checked the path and CacheTest file is in the correct folder. When I run the symfony project from the command line it works just fine.
Is there someway to fix this problem?
What you try is not correct. You execute the php.exe and that is the normal PHP executable. To run your Unit-Tests you need PHPUnit to run.
Go to Preferences -> Languages & Frameworks -> PHP -> PHPUnit and define the phpunit.phar.
When you've done that you create a new configuration to run PHPUnit and you define the configuration which is under app/phpunit.xml.
I figured it out. First of all you need add phpunit.phar as Stony explained in his answer.
After that all I really needed to do was to rename phpunit.xml.dist to phpunit.xml in app/ folder and then just right click it and choose the Run 'phpunit.xml' option. This way the Tests succeed and it doesn't give any errors.
As for running the symfony project you need to add symfony command line tool support to phpstorm. All about that in this link: https://confluence.jetbrains.com/display/PhpStorm/Symfony2+Command+Line+Tool+Integration+-+Symfony+Development+using+PhpStorm
After that you just run it as a command like you would with normal command line. That's also explained in the link.
Try to choose "Use custom autoloader" option in Preferences -> Languages & Frameworks -> PHP -> PHPUnit and specify the path to vendor/autoload.php file.

Error on Zend controller creation

I'm attempting to build a test project with the Zend framework and using MAMP to run it on my local host.
The project creation works fine; I navigate to my htdocs directory and use zf create project my_zend to create the scaffold.
My error comes when I try to create a controller "students" by using the following command zf create controller students, however, once this command runs it outputs the following error:
Context by name servicesDirectory does not exist in the registry.
Where does this error come from?
I had the same problem, here is how I fixed it, check for the line:
<servicesDirectory enabled="false"/>
In the .zfproject.xml file and remove it.
You might get this error if you have another version of zend some where in the path. If you have one try deleting it and using the latest or the version you wish to. This worked for me in xamp on windows 7 hope it works for you

zend framework : "A project profile was not found" zf version 1.11.7

I am trying to develop a project in zend framework. I have created a project gil using command line as follows then I entered to the project directory in command line and tried to create an action but I got an error as follows. I am using Windows XP and XAMPP and my Zend frameworks version is 1.11.7.
C:\xampp\htdocs\zframework12>zf create project gil
Creating project at C:/xampp/htdocs/zframework12/gil
C:\xampp\htdocs\zframework12>cd gil
C:\xampp\htdocs\zframework12\gil>zf create action add index
An Error Has Occurred
A project profile was not found.
Zend Framework Command Line Console Tool v1.9.0
Details for action "Create" and provider "Action"
Action
zf create action name controller-name[=index] view-included[=1] module
C:\xampp\htdocs\zframework12\gil>
Please help to sort out this issue
Thank you very much
In the second prompt, you type: cd gil . So, you'll move in the gil directory. This directory doesn't contain the zf xml file called .zfproject.xml (hidden). You should type:
zf create action add index
In the root directory: C:\xampp\htdocs\zframework12
I have the same problem, which caused by moving from one folders into another that lead to missing deleting hiden file .zfproject.xml. The solution is creating a new project "create project newname" and move all former files into this one.
Had the same problem with zf 1.12.9.
In my case, i was trying to execute command
zf1 enable layout from the parent dir to the project.
The solution was to go to the correct directory and then execute command.
This link helped me with my problem
original solution source
copy your zf.bat file to your new project 'gil' directory

Zend Framework create project error

I am new to the Zend Framework. I read the Zend Framework document. Here I saw to work Zend Framework must include the path in my php.ini, I believe that this is done because in my php info I saw include path is C:\www\zend_frame\library
Also in document it says that to create a project I must run:
C:\> zf.bat create project quickstart
I want to create a project in C:\wamp\www
In my command shell I ran:
C:\>wamp\www> zf.bat create project quickstart
But I got an error message (see below).
Then I tried another way:
C:\>wamp\www> C:\wamp\zend_frame\bin\zf.bat create project quickstart
Here I got the same error:
Php.exe is not recognised as an internal or external command, operable program or batch file
I also set the path in My Computer settings
The Zend Framework zf.bat script assumes that it can run "php.exe" without specifying the full path to that executable, and it will be found because you have set your PATH to include that directory:
SET PATH=%PATH%;C:\wamp\bin\php
Depending on the version of WAMP, the php.exe may be in a subdirectory for the version of PHP. In that case you need to use a command something similar to this:
SET PATH=%PATH%;C:\wamp\bin\php\php5.3.0
You should be able to figure it out from here.

Categories