I just switched from NetBeans to Eclipse (PDT). I am using Kubuntu 14.10. I really love it, but I can't get an important feature working: composer and other (symfony2) commands.
I've tried to run composer update (using this great plugin), but I'm getting this error:
[bundle] requires ext-curl * -> the requested PHP extension curl is missing from your system.
It's working in NetBeans, so it's installed. For some reason, Eclipse doesn't recognize it.
How can I the CLI in Eclipse, so I can run commands? That solves one of my problems and helps me finding out why Eclipse can't find the Curl extension.
Update: composer is working
I've installed php5-curl, so composer is running fine. For some reason that packages wasn't needed to run composer in NetBeans, but it is in Eclipse.
So part of my problem is solved, but I still don't know what the best way of running (Symfony2) commands is.
Eclipse does not necessarily use the same PHP that NetBeans used. Or the configuration differs. If that extension is reported to be missing, that's exactly what the problem is with the PHP you are using when running the command.
Find the location of the php.ini file by running php -i or phpinfo() (in a script on the command line, just like you run Composer) , and add the curl extension there.
If you are linux/macports user, you have to enable "use system default php.ini configuration" in preferences/php/php executables.
Related
Hello and thank you for taking your time to read this! Now to get straight to the point, I am using MAMP PRO 6 for school and recently we had to install Composer through the terminal. Upon closer inspection php -v revealed that I am not using the MAMP's php version with Xdebug but rather the pre-installed php version that comes with macOS. I have enabled Activate command line shortcuts for the selected PHP version, pear & pecl but this is not working. I'm on the latest Big Sur update and looking for a possible fix.
MAMP PRO is working with the exception of command line shortcut.
Depending on the shell you use (bash, zsh, check your OS) just add "source ~/.profile" to your bash, zsh-or other profile. MAMP PRO 6 recreates the .profile when changing php versions.
Check the "composer"-link in the UI and everything should work just fine. Don't forget to start a new terminal session though. Otherwise the old configuration (with the old php and more) stays active.
~/.profile is not being read. You have to define a ~/.bash_profile, ~/.zshrc or something. In that profile that is read by the shell you put the "source"-statement.
The issue is that my .profile is not being loaded automatically , current workaround is doing source ~/.profile and then confirming the location and version with which php and php -v.
Update: This did it for me https://stackoverflow.com/a/56236178/14612433
I am new to OS X environment. I need to setup php dev environment so I've phpStorm IDE + php 5.4 (cli) with xdebug 2.2.3 + apache 2.1 installed and configured.
When I tried to build my project, I got an error as
php-cgi not found
I've read few solution and tried to make a facts php but then I got cURL error saying that
reinstall libcurl as easy.h should be in /use/include/curl.
I'm having easy.h at same location. How do I make through this step ?
I got the solution.
Found it as, I needed to install Xcode for Command Line.
$bash~# xcode-select --install
Now, another problem is mysql header files can't be found at
/usr/local/Cellar/mysql/5.6.24/include/mysql
Netbeans claims they support Composer in Netbeans 7.3. However, I can confirm that I am running version 7.3, but there is no composer options in the PHP section of my preferences (running OSX 10.8.4)
Is there something else I have to do to get this working?
Thanks.
just right click your project (the root of the directory tree) and you will see the composer menu
Well, turns out that for some reason in OSX, it didn't install the Composer module. Don't know why, in Windows, it was installed from the get go. I had to install it from plugins, and I had initially missed it because it was titled "PHP Composer" and I was looking for simply "Composer"
I need the MongoDB PHP driver on my CentOS 5.4 machine. My PHP version is 5.1.6. I downloaded the RPM and installed it. That created several files in /usr/bin directory. I copied
/usr/bin/mongo
to
/usr/lib/php/modules
which was what extension_dir showed on doing phpinfo();.
I also added
extension=mongo.so
in /etc/php.ini.
However on executing my PHP script, i still get
Mongo class not found.
What's going wrong here ?
Also, my phpinfo() shows PHP version 5.1.6 whereas running PHP from command line shows 5.3.3. Could anything be wrong with that ?
Thanks in advance.
You're saying your webserver and command line PHP report different versions. These are going to be installed in different locations, and their extensions are API incompatible with each other.
When you installed the php_mongo extension, it may have used the command line php to determine the directory to install the extension to.
Make sure you have the correct php_mongo for the php version of your webserver, and it is in the correct extensions directory. (get the directory from the php.ini returned by phpinfo())
I hope you realise PHP 5.1 is also many years out of date. Unless you have a specific reason to use a version that old, you should also look at upgrading to a more recent version.
Edit:
Just read your comment "I must also mention that /usr/bin/mongo is a binary executable file but its not having a .so extension. Im copying it as is to /usr/lib/php/modules"
No no no! :)
This is the mongo command line client. This is not the PHP extension!
You can run a find /* -name "mongo.so" to see where the installer put the file, this will probably also give you an indication of which version of PHP it was installed for.
It looks as though you are confusing the RPM-packages for the MongoDB server with the requirements to install the MongoDB PHP driver. The PHP driver provides access to the server from your PHP applications, and does not install any command line tools.
restart httpd !
yum service httpd restart
hey guys I need your help for setting environment for zendframe work ? I have installed my netbeans in D: drive under D:/program files/netbeans. and the zend framework is under D: drive. and my wamp package is installed under c:/wamp. now what i need is to configure these all for my development?
I searched google, stackoverflow and every blog i could for the whole day. but all that I got is a error given below.
'"php.exe"' is not recognized as an internal or external command,
operable program or batch file.
tell me how can I solve this ? what should I do ? Do I need to set all these under one roof or I need to upgrade my PHP version ???
Yes My config is written below.
WAMP Server 2.0c with PHP 5.2.6, MySQL 5.0.51b, Apache 2.2.8.
Netbeans 7.1.1 and Zend framework 1.11.11
Add php.exe to your environment variable PATH. If you add the directory where php.exe is installed to your PATH environment variable (you may need to log out for it to take effect), it should work.
See this tutorial
You may actually specify the path to PHP interpreter within Netbeans, in Options - PHP - General tab.
Perhaps you should set up the include_path as well to make Zend modules (at least autoloading one) recognizable.
Update to a more up-to-date version of PHP first.
Then, ensure that PHP is on your environment PATH variable. You can look up on google how to do that.
You'll have to install phpunit too after you get that setup. WAMP might come with it but I doubt it. Usually this is easy if you have pear. You can get the pear commands from the phpunit site.
If you don't have pear you'll have to install that. Download a 'go-pear.phar' file that is appropriate to you. You usually install it by running php go-pear.phar' and then you can use pear it install phpunit.
You can then call it a day OR you can continue setting up Netbeans to automatically use phpunit.
If you don't setup netbeans then you'll have to just use phpunit on the command line.
After the pear phpunit install just run phpunit on the command line and you should get some sort of 'help' output.
Edit : Step by step details.
I'm going to assume you have xdebug, php, netbeans installed from your comments. It seems like your only issue is installing phpunit.
Here goes.
Open up a command prompt
Open a browser window.
In your browser go to http://pear.php.net/go-pear
Save the text file that comes up into the directory php is installed in.
Go to the php directory php is installed in via the cd command on the terminal.
Type in the command php go-pear.phar
Follow the installation instructions for pear and pick the options that make the most sense. I just install everything in the php directory so php and pear live in the same place.
After pear is installed type in the following commands ( from the phpunit install website : http://www.phpunit.de/manual/current/en/installation.html ) You might have to use sudo here, if you're on windows maybe not.
pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit
9 Run phpunit -h on the command line and you should get some help message. If you're on windows you might have to open up a new command line prompt before you try this.