Quick background.
Running OSX Mavericks.
Want to run xdebug in NetBeans
Pear runs okay
xdebug stopped running after OSX upgrade. Tried to reinstall. During the install I get:
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
But in phpinfo:
PHP API 20121113
PHP Extension 20121212
Zend Extension 220121212
Best thing I can figure out (after hours of trawling through similar issues) is to make sure I am using the correct version of phpize.
which phpize returns:
/Applications/MAMP/bin/php/php5.5.3/bin/phpize
whereis phpize returns:
/usr/bin/phpize
My question is in two parts:
Is the different PHP API Version likely to stop xdebug from running and; how can I make sure that I am using the correct version of phpize?
A wrong API makes Xdebug to not even load, so yes, that is a problem.
To use the correct one, you will need to figure out which php binary you use in the first place. It is likely that if you use MAMP's php binary, its in the same directory as the phpize you need to use. The same for /usr/bin/phpize, which should match /usr/bin/php's API numbers. phpinfo() output might give you hints as to which PHP binary is being used.
Related
I use MAMP for local php development and recently needed to use php's pspell functions for a project. I found little help with this specific scenario (short of recompiling php, yuck) so this post explains how I got it done.
I am not positive but you may need xcode and xcode command line tools installed for this to work. This article might be helpful.
Install MacPorts if you don't have it already
Install aspell and the dictionary of your choice (I used "en"):
sudo port install aspell aspell-dict-en
note: for the next commands, you need to know the version of php you're running on MAMP. You can find this in the MAMP preferences under the PHP tab. For me it's 5.5.18
Download the php source for the version of php you are running,
unarchive it, and move into the pspell source directory:
cd ~/Downloads/php-5.5.18/ext/pspell
Now (being sure to use the proper phpize binary for your php version) do:
/Applications/MAMP/bin/php/php5.5.18/bin/phpize
You should see something like:
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
Next:
./configure --with-php-config=/Applications/MAMP/bin/php/php5.5.18/bin/php-config --with-pspell=/opt/local/
And finally, build the module file:
make
You should now have two files inside the ./modules/ directory: aspell.so and aspell.la - copy them into your php's extensions directory:
cp ./modules/* /Applications/MAMP/bin/php/php5.5.18/lib/php/extensions/no-debug-non-zts-20121212
Now add the extension to your configuration file in /Applications/MAMP/bin/php/php5.5.18/conf/php.ini
extension=pspell.so
Finally, restart your MAMP servers and (hopefully) you are good to go!
I'm really at a loss with this, I just dont understand how to fix this error.
Xdebug requires Zend Engine API version 220121212.
The Zend Engine API version 220131226 which is installed, is newer.
I've read something about phpize but when I run the command I get...
Make sure that you run '/usr/local/bin/phpize' in the top level source directory of the module
I'm not sure what this means. What is the top level source directory?
Can anyone help me please?
Thanks
I found this which I think it will help you
https://xdebug.org/wizard.php
Edit
Also worth noting this FAQ guide here under Compilation and Configuration --> Q: What to do with: Xdebug requires Zend Engine API version xxxxxxxx. The Zend Engine API version 2xxxxxxxx which is installed, is newer.
Q: What to do with: Xdebug requires Zend Engine API version xxxxxxxx.
The Zend Engine API version 2xxxxxxxx which is installed, is newer.
A: This message means that you are trying to load Xdebug with a PHP version for which it wasn't built. If you compiled PHP yourself, it is most likely because you compiled Xdebug against PHP headers that belong to a different PHP version that you're running. For example, you're using PHP 5.3 and the headers you're using are still PHP 5.2. If you are using a pre-compiled binary, then you're using the wrong one.
To diagnose if this is your problem, make the following steps:
Check what the "Zend Extension" API number is of the PHP version that you are running by looking at phpinfo() (or "php -i") output. You can find it in the top part of the output, in the same block as the PHP logo and the PHP version. As examples, for PHP 5.2, the number is "220060519" and for PHP 5.3 it is "220090626".
Check what the output of "phpize" is when you're completing the compilation steps. The number that you're looking for is on the line that says "Zend Extension Api No".
If the two numbers from above do not match, you're compiling with the wrong PHP headers. Refer to the next FAQ entry to figure out which phpize to use.
it's easy, this is working on me. just install this
sudo apt install php7.3-xdebug
or you can choose your own php version. php7.1-xdebug, php7.2-xdebug and etc
Run: phpize --help This shows you the full path to phpize. This path should be the same as where you have the CLI binary, php-config and the "pear" and "pecl" binaries installed. If you run php-config --version it should show the same version of PHP that you're running. If it doesn't match up, and perhaps the wrong "phpize" binary is found on the path, you can run configure as follows:
/full/path/to/php/bin/phpize
./configure --with-php-config=/full_path_to_php-config
In my case on i used this path for lampp and it worked.
/opt/lampp/bin/phpize
./configure --with-php-config=/opt/lampp/bin/php-config
Or you can follow this xDebug Installation Wizard
I am new to mongodb. I just installed mongodb on our development (linux) server:
I got mongodb to work on my console and I could load and save data, but when I wanted to install the PHP driver and altered the php.ini I got this error: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mongo.so
I searched the internet about this and all I could find was about 32bit and 64bit differences between php and the so file but as far as I know the computer that all this is installed on is only 32bit so everything on it will be 32bit as far as I know.
I installed the driver using pecl install mongo
also tried to pecl download mongo phpize it and set something to -m32 found that somewhere on the Internet, then make it and still didn't work.
Below some more info you might need in order to be able to help me out here.
uname -m
i686
file /opt/lampp/bin/php-5.3.5
/opt/lampp/bin/php-5.3.5: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.0, stripped
file /opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mongo.so
/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mongo.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped
phpize --version
Configuring for:
PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
Hope someone knows how to get this to work. I'm not quite a linux guru, know my way around a bit but please tell me exact steps to follow...
-mac-
--
also tried the bradly henk method on this page: http://us2.php.net/manual/en/mongo.installation.php but that didn't work either
just upgraded from 1.4.3 to 1.4.4 using pecl upgrade mongo. This didn't solve the problem. php version installed = 5.3.5 (lampp) and mongo version installed = MongoDB shell version: 2.4.6
The 1.4.4 version of the php driver should work for PHP Version: PHP 5.2.6 or newer, but then again the 1.4.3 version should also have worked on 5.2.6 or newer
/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mongo.so
phpize --version
Configuring for: PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525
Note the difference in the API Number here.
You seem to have multiple installations of PHP on your system.
You need to use the pecl (and phpize) tools that match the PHP version you want to load the module under.
I suspect you'll find the correct pecl binary under /opt/lampp/bin/pecl
I’m trying to install Xdebug on a Linux machine for remote debugging of PHP. I’ve come across a number of issues in trying to build it, I appear to have resolved some but I feel stuck right now. Short description, “make” does not complete successfully, says it can’t find zend_config.h or TSRM_config.h. Not sure how to go about getting these.
More in-depth explanation: (note I’m not super Linux savvy so if you see something that I’ve done that is blatantly wrong, please let me know)
I’m trying to follow the instructions I received here from providing my phpinfo() details (see end of post). I was originally getting a number of errors similar to these when trying to “make”:
Error: ‘ZEND_USER_OPCODE_DISPATCH’ undeclared (first use in this function)
Error: ‘ZEND_RAISE_ABSTRACT_ERROR’ undeclared (first use in this function)
Etc.
My guess was that it wasn’t phpize’d with the proper version of Zend (if I’m wording that correctly). Going back to the phpize step, the versions that are returned do not line up with phpinfo(). Rather than seeing:
PHP Api Version: whatever
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
I instead see:
PHP Api Version: 20020918
Zend Module Api No: 20020429
Zend Extension Api No: 20050606
To make things more complicated, I’m running an older version of XAMPP (1.6.8a) that allows me to switch between PHP 4.4.9 and PHP 5.2.6 (currently trying to transition PHP versions on my job and debugging would really speed things up). I currently have PHP5 mode running. Checking /opt/lampp/bin/phpize, I see that it’s a symbolic link to “phpize-5.2.6”. My guess is that XAMPP just switches the link depending on the version of PHP that it was told to start up with. Anyways, that part seems fine and I run phpize-5.2.6 for a sanity check and still get the old version numbers. Now, php-config is setup similarly, running php-config --version returns “5.2.6” which is just fine.
I do some more digging and run across this post (2nd to last in thread). I end up downloading the PHP source for version 5.2.17 (hopefully that’s close enough) and creating the soft link as described in the thread. Phpize versions look much better now and line up with what the Xdebug site says I should see:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
“Make” is now throwing the missing header file errors listed above. I see this post and decide to play around with my configure file.
I commented out
-no-create | --no-create | --no-creat | --no-crea | --no-cre \ <br/>
| --no-cr | --no-c | -n)
no_create=yes ;;
And removed –no-create from this line:
set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
Still no luck. I assume configure is supposed to create these config files or something? Not sure what to try next. If it helps, I’m running SUSE SLES 10. Thanks.
Xdebug custom generated install instructions:
SUMMARY
• Xdebug installed: no
• Server API: Apache 2.0 Handler
• Windows: no
• Zend Server: no
• PHP Version: 5.2.6
• Zend API nr: 220060519
• PHP API nr: 20060613
• Debug Build: no
• Thread Safe Build: no
• Configuration File Path: /opt/lampp/etc
• Configuration File: /opt/lampp/etc/php.ini
• Extensions directory: /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613
INSTRUCTIONS
1. Download xdebug-2.1.0.tgz
2. Unpack the downloaded file with tar -xvzf xdebug-2.1.0.tgz
3. Run: cd xdebug-2.1.0
4. Run: phpize
As part of its output it should show:
Configuring for:
...
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
If it does not, you are using the wrong phpize. Please follow this FAQ entry and skip the next step.
5. Run: ./configure
6. Run: make
7. Run: cp modules/xdebug.so /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613
8. Edit /opt/lampp/etc/php.ini and add the line
zend_extension = /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so
9. Restart the webserver
It looks like you are using an old version of PHP, which may mean that you are using a PHP package from your linux distribution.
If that's the case, first check if your distribution provides a xdebug package. If not, you may have to install the php*-dev or php*-devel package, in order to build a module.
So turns out I needed an additional flag when running configure:
--enable-xdebug
Pretty simple but the instructions I was using never mentioned this. Only found out about it after browsing through Xdebug's discussion list archive.
Note, though "make" seemed to work without error the first time I did this, I still did not get an xdebug.so file in modules/. I then did a "make clean", ran phpize again, configure and then make, this time I got the file.
I've installed the sphinx binaries and libraries and am now trying to install the PECL sphinx module.
My system is running OS X 10.6 with MAMP 1.8.2 installed. I try to install sphinx using the following command:
sudo pecl install sphinx
The PECL command outputs the following:
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
The versions above don't match the versions listed when doing a phpinfo(). It seems that PECL is trying to complie against the built-in version of PHP.
If I ignore the errors and continue the it will successfully compile and place the sphinx.so file in:
/usr/lib/php/extensions/no-debug-non-zts-20090626/sphinx.so
when in fact it should be:
/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/
I've tried copying the sphinx.so file to the MAMP extensions dir but when I restart apache PHP displays the following warning:
PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/sphinx.so
I think this is because MAMP is 32bit and the built-in PHP is 64bit so PECL complies for 64bit. I might be completely wrong but I did read this when I goggled on the topic.
Does anyone know how to get PECL to map to the MAMP version of PHP instead of the built-in version?
If the "correct" version of PHP is installed in something like /Applications/MAMP/bin/php5/, and has the development tools included, you should have some version of the pecl command to go with it, some next to that directory.
If so, running that pecl command that corresponds to your "correct" version of PHP should help : it'll run the correct version of phpize, and will allow the extension to be compiled against the (once again) correct version of PHP.
You just have to hope that MAMP includes those commands -- I cannot check, as I don't have a mac.