I am haveing problem to setup zend framework into netbeans.
I have assign all setting in netbeans:
Tool>Options>PHP>Zend>
I have put the path of zend directory where I have extract the zend framework directory.
and >Tool>Options>PHP>General>
I have put the C:\xampp\php\php.exe in php 5 Interpreter
And give Global Include Path :
c:\xamp\php\PEAR
and
c:\zend\library\zend\
Also
I have set path in environment variable for php : C:\xampp\php\php.exe
and
in php.ini :
include_path = ";C:\xampp\php\pear\;C:\ZendFramework-1.11.12\library;"
My configration:
Window 7
xamp1.1.2
ZendFramework-1.11.12
Netbeans 7.1
Please can any one help to me?
In Netbeans, Tools > Options > PHP > Zend > is the path to zf.bat, like: C:\Zend\ZendServer\share\ZendFramework\bin\zf.bat.
Don't forget to select the register provider button after you change this value. This is the setting that controls how Netbeans interacts with Zend_Tool.
Netbeans Global Include Path : c:\xamp\php\PEAR and c:\zend\library\zend\ the global include path in Netbeans is only used for Netbeans modules like for autocomplete.
You windows environment PATH variable needs to point to the Zend Framework /bin like: C:\Zend\ZendServer\share\ZendFramework\bin as Windows also needs to know about zf.bat but really doesn't need the library location.
php.ini does need the location of your ZF /library folder. Just make sure this is the php.ini used by Apache at a minimum. Sometimes you'll have 2 php.ini files: one used by Apache and one used by php cli (command line interpreter). Every server setup seems to be different as regards to where the php.ini files are so plz check the documentation and phpinfo() can probably help.
Related
I have PHPStorm 8.0.1.
PHPUnit is installed via PHAR archive like:
wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/bin/phpunit
PHPUnit works via cli:
user#pc:/usr/bin$ cd ~
user#pc:~$ phpunit --version
PHPUnit 4.3.5 by Sebastian Bergmann.
I followed the instructions from JetBrains website https://www.jetbrains.com/phpstorm/webhelp/enabling-phpunit-support.html#d298258e897
In PHPStorm File->Settings tab PHP/PHPUnit
the radio button Path to phpunit.phar is checked
and value is set to /usr/bin/phpunit
I have a file with a test defined like:
class MyTest extends PHPUnit_Framework_TestCase {
...
At this point PHPStorm marks Undefined class PHPUnit_Framework_TestCase
I've restarted PHPStorm and Computer, but still have the same problem.
I've also tried adding /usr/bin to include path (right click on external libraries in project view, and choose option Configure PHP include paths) without success.
Here's the config for PHPStorm Settings, tab PHP (if it matters):
PHP Language level: 5.5 (finally, generators, etc.)
Interpreter: PHP 5.5 (5.5.9-1ubuntu4.5)
Include path is empty
In order to have a PHAR archive indexed by the IDE it has to have a .phar extension (that's a requirement).
The easiest solution is to place phpunit.phar somewhere in your project (usually it would be PROJECT_ROOT/vendor/ folder).
If having local copy inside the project folder is not desired (for whatever reason; although Composer and other similar kind of tools (bower/npm/etc) are primarily aimed at keeping dependency stuff/packages locally), you may use symbolic links:
either create a symbolic link to that file locally (e.g. PROJECT_ROOT/phpunit.phar --> /usr/bin/phpunit)
or place a full copy (or such symbolic link) in a separate folder outside of the project and then reference it via PhpStorm's Settings | PHP | Include Paths functionality.
The above fix by Calin worked for me too on PhpStorm 2019.1.1, so I'll post it as an answer for easier visibility:
Try right clicking on the .phar and clicking "Exclude phar from project", then clicking "Include phar into project" to refresh it.
In my case, both the .phar file and my .idea folder were pulled from a git commit. I guess PhpStorm didnt realise that the file needed reimporting.
I noticed even though PHP itself can find and run phar that is in its include path, PHPStorm having trouble finding and parsing them.
LazyOne's explanation is correct, however, I didn't need to put it in project folder to be recognized, you can put them in any path as long as its path is introduced to IDE. In my case, I put all phar files in PHP folder, so I just needed to add PHP folder to Include Path list in IDE
Include Path for PHP is under Settings -> Language & Frameworks -> PHP screen (that tiny + at the bottom of screen).
I am completely begginer with ZEND FRAMEWORK. I tried to install but was getting some error.
As I go with the zf#1 version installation.
I extracted my folder to the path. C:\xampp\php naming it as zendframework.
I edited my php.ini file's include_path as include_path = ".;C:\xampp\php\PEAR;C:\xampp\php\zendframework\library"
Restarted Server.
Run cmd with path C:\xampp\php\ (where my exact zf.bat files)
Running command zf show version ended with zf error that my zend framework should be in include path.
How to resolve this error?
Is issue is resolved my next command zf create project zend_blog is correct?
How to create project with zf1 and zf 2 ?
Follow the given Instruction Below.
• Go to ‘My Computer’ > Properties > Advanced Tab > Environment Variables.
Environment Variables box will open, View SYSTEM VARIABLES,
scroll the list to ’ PATH ‘ > double click ’ PATH ‘ .
Add the following line to the end of the PATH C:\xampp\php
Zend Framework
• Extract the Zend Framework files to C:\xampp\php\zf.
• Edit the php.ini file. You will find it at C:\xampp\php\php.ini.
Find the line that says ’ include_path ’ and edit the line:
Windows: “\path1;\path2″
include_path = “C:\xampp\php\zf\library”
• Open a shell and cd to C:\xampp\htdocs folder and type this:
C:\xampp\htdocs>C:\xampp\php\ZendFramework\bin\zf.bat create project testproject(project name)
• Now Copy the Zend Folder from your ZendFramework folder ( C:\xampp\php\zf/library /Zend) into the library folder of your new test project ( C:\xampp\htdocs\testproject\library\Zend
it has nothing to do with XAMPP. Something is not configured right or not correct privileges.
See these:
Setting up the CLI tool on Windows
Also, see this thread
You can also consider using NetBeans IDE, it has great support for ZF tool. Check it out this tutorial.
you need to put the zend framework path and the php.exe path into your windows path variable in order to run commands from the command line. This is important in ZF1 so that Zend_Tool will work at the command line or in Netbeans or other Ide's.
I am very new in Zend framework and I want to learn this framework.
So I have downloaded ZendFramework-2.0.5 version but I dont know how can I install it, run it and work on it.
I want to install it into WAMP server , Eclipse IDE and window XP os.
Please tell me all the useful step to achieve it.
Thanks in advanced.
The easiest way to work with a library would be to add it to your php.ini include path, like :
include_path = ".;c:\php\includes;C:\wamp\apps\ZendFramework-2.0.5\library"
I would recommand you to put it in the Apps folder of wamp, this way it's not project specific. The other way would be to put the Zend folder from the bundle in the library folder of a Zend project
To be able to use the ZF tool (create project and a few other things) you also need to add to your environment variables the path to the folder containing the zf.bat command line tool
Terms might differ since I have a french version of Windows, but translation should be accurate enough
right-click on your computer and select properties
Advanced systems settings
Environment variables
In the section Variables for user ..., click on create and name the new variable ZF and set C:\wamp\apps\ZendFramework-2.0.5\bin as the value
In the section System variables find the key path and add the same path at the end (make sure to put a ; before pasting your new path)
Start a command line tool in admin (right-click on icon and select run as administrator) and type zf, you should get the help text from the ZF tool
From there you should be able to create a new project where you want by following the quick start given in the documentation
You might want to create a new virtual host for your project as well
You can then try the follow tutorial (one of the bests)
I have a PHP script to run. If I run it from the command line, it works fine (include path is set correctly).
If I want to run it inside Eclipse (Run as script), then the PHP include path of my php.ini is replaced by Eclipse, with all the libraries I've added to the project.
I've configured my PHP executable in Eclipse. I've set the correct PHP executable file, and I selected my php.ini file too (the right one, I've checked). But it is ignored...
Edit : this is an Eclipse bug :
https://bugs.eclipse.org/bugs/process_bug.cgi
Wouldn't manually re-adding the old paths using
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
in the first line of the script you're running work?
Could you add the current php include path as a linked folder within your project, in order to reference that linked directory in the PHP include path?
alt text http://files.zend.com/help/PDT/include_path_properties.png
That way, even if your path is replaced, it will be replaced by:
your path
all the other librairies
This is a bug of Eclipse, 3 bugs have been filled about it but none of them got fixed.
No solution without modifying your PHP files.
https://bugs.eclipse.org/bugs/process_bug.cgi
In Eclipse for PHP Cli Applications
1) Click on Project Properties
2) Click on Include Path
3) Add external folder and/or Source and/or Libraries
After doing such I was able able to run my programs. If I didn't do the above I was having to use the function
set_include_path(get_include_path() . PATH_SEPARATOR . "c:\PHP\PEAR"); etc...
For PHP Web applications I wasn't having issue because I put my include_path var in the Apache2 vhosts file along with my configuration.
I installed Netbeans 6.8 but in the PHP framework list it does not show Zend framework. Do I need to configure it? How do I do that?
Same this one : http://blogs.oracle.com/netbeansphp/entry/zend_framework_support_added
This feature will be in the next release (AFAIK 6.9 is planned at the beginning of the summer). You can already download (or compile by yourself) dev build and try it out.
For now, ZF support in Netbeans it is just a wrapper for command line Zend
_Tool. You just configure your zf.bat path and that's it.
There is a great plugin named "Path Tools" (get it from the netbeans plugins page). This will allow you to open a command window in your project directory. Then, creating a new project is really easy(ofcourse, you need to have zf.bat and php.exe in your path). Simply open command window..
. zf create project
. (you will be prompted for directory.. enter '.' for current dir)
Netbeans does not create ZF projects. So first you need to create ZF project yourself using Zend_Tool, and than in NetBeans create New Project (File->New Project) and select PHP category with 'PHP Application with Existing Sources' and off course point to your newly created ZF project.