trying to install xdebug: configure file not found - php

I am following these instructions to download xdebug: http://xdebug.org/wizard.php. The output of the wizard was this:
Summary
Xdebug installed: no
Server API: Apache 2.0 Handler
Windows: no
Zend Server: no
PHP Version: 5.4.17
Zend API nr: 220100525
PHP API nr: 20100525
Debug Build: no
Thread Safe Build: no
Configuration File Path: /bitnami/mampstack-osx-x64/output/php/lib
Configuration File: /Applications/mampstack-5.4.17-2/php/etc/php.ini
Extensions directory: /Applications/mampstack-5.4.17-2/php/lib/php/extensions
giving these instructions
Download xdebug-2.2.3.tgz
Unpack the downloaded file with tar -xvzf xdebug-2.2.3.tgz
Run: cd xdebug-2.2.3 Run: phpize (See the FAQ if you don't have phpize.
Run: ./configure
Everything works properly up to step #4. In step #4 I get
MyMacBookAir$ ./configure
-bash: ./configure: No such file or directory
If I look in xdebug-2.2.3 I see that there is no file called configure -- but I do see a file called configure.in. Did I get .tgz that is missing the configure file? Or am I not understanding some part of the instructions properly?

Actually it could be a problem with phpize command
If it complains for autoconf ("Cannot find autoconf") then try next
curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz
tar xzf autoconf-latest.tar.gz
cd autoconf-*
./configure --prefix=/usr/local
make
sudo make install

#akh2103 I assume you have your problem fixed by now but I leave this answer here for anybody else has this issue.
I've just suffered from the same problem. For me I was installing it on a linked directory
eg ~/Downloads was actually on /media/1234/Data/Downloads
For some reason when I transferred all my downloads onto my other HDD the other day the permissions have been haywire.
After I moved the initial xdebug file to my ~/.Desktop and unpacked it there I ran
chmod -R 0755 x-debug/
and then ran phpize
Then I could see the configure file that didn't appear when I tried to do it on my other HDD.
I hope this helps anybody else who suffered from this problem.
John

Related

Unable to use PHPIZE after update to MacOS Mojave

What i should do when i run PHPIZE and get the error below ? I already installed xcode command line tools.
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Potential better solution - force reinstall the header files. Fixed a ton of problems for me system wide.
Running the following command will reinstall the developer tools header files and should fix the issue.
$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
For some reason, I found Xcode command line tools was not installed completely on my Mac, Finally I solved this problem as follow:
1. xcode-select --install
2. cd /Library/Developer/CommandLineTools/Packages/
3. open macOS_SDK_headers_for_macOS_10.14.pkg
Note: After doing step2, if there is no .pkg file in the dir. maybe this solution will not help you.
find the phpize and edit it,
~$ whereis phpize
phpize: /usr/local/bin/phpize
~$ vim /usr/local/bin/phpize
in my phpize script it is like that
prefix='/usr/local/php7' ## where you should edit
datarootdir='/usr/local/php7/php'
exec_prefix="`eval echo ${prefix}`"
phpdir="`eval echo ${exec_prefix}/lib/php`/build"
includedir="`eval echo ${prefix}/include`/php"
...
phpize_get_api_numbers()
{
# extracting API NOs:
PHP_API_VERSION=`grep '#define PHP_API_VERSION' $includedir/main/php.h|$SED 's/#define PHP_API_VERSION//'`
ZEND_MODULE_API_NO=`grep '#define ZEND_MODULE_API_NO' $includedir/Zend/zend_modules.h|$SED 's/#define ZEND_MODULE_API_NO//'`
ZEND_EXTENSION_API_NO=`grep '#define ZEND_EXTENSION_API_NO' $includedir/Zend/zend_extensions.h|$SED 's/#define ZEND_EXTENSION_API_NO//'`
}
if you comfirm that you have the header file but the phpize script configure is wrong ,you can edit the row
prefix='/usr/local/php7'
and php.h is in
$ pwd
/usr/local/php7/include/php/main
$ ls php.*
php.h
if not ,you can compile php by yourself
I had the same issue as described above, only I was trying to install xdebug on macOS Mojave.
I resolved the issue by executing:
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

Failed-loading xdebug installation - xdebug.so, 9 no suitable image found

After installing xdebug extentions as follows
Download xdebug-2.6.0alpha1.tgz
Unpack the downloaded file
Run: cd xdebug-2.6.0alpha1
Run: phpize
Run: ./configure
Run: make
Run: cp modules/xdebug.so
/usr/local/Cellar/php70/7.0.26_18/lib/php/extensions/no-debug-non-zts-20151012
Edit /usr/local/etc/php/7.0/php.ini and add the line zend_extension =
/usr/local/Cellar/php70/7.0.26_18/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so
I get the error when run php -v
Failed loading /usr/local/Cellar/php70/7.0.26_18/lib/php/extensions
/no-debug-non-zts-20151012/xdebug.so:
dlopen(/usr/local/Cellar/php70/7.0.26_18/lib/php/extensions
/no-debug-non-zts-20151012/xdebug.so, 9): no suitable image found.
Did find:
/usr/local/Cellar/php70/7.0.26_18/lib/php/extensions/no-debug-non-zts-20151012/xdebug.so:
stat() failed with errno=20
When I use the service of Xdebug analyse popinfo() output, it will ask the exactly the same steps to do.
It am not sure what no suitable image found means. The path exists. Could anyone have any ideas how to fix it?
I sorted the problem out by adding
export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"
on .bash_profile.
PHP 7.1 came with OSX 10.13.2, so default path was set to the pre-packed php, which shows the error on phpinfo.

PHP openssl in Ubuntu

I have created a web app which uses PHPMailer for mailing and its working properly on my local server(Windows OS). However, when I uploaded it to the production server(Ubuntu 14.04.4) it returned an error which says “Message could not be sent.Mailer Error: Extension missing: openssl”.I tried looking for solution but nothing works. Anyway I'm using PHP5.3.6. I hope you guys can help me.
You can compile the openssl extension.
first step :
download the php source in the version you are using .
then run command:
tar zxvf php-yourphpversion.tar.gz
cd php-yourphpversion/ext/openssl/
#notice if you have error "cannot find config.m4" when run phpize , you
#should rename the file "config0.m4" to "config.m4" by command
#"mv config0.m4 config.m4"
/usr/local/php/bin/phpize #here is your php location have install
#in my computer ,the php is location in
# /usr/local/php/ so the phpize is in
# /usr/local/php/bin/phpize
#(your php location)/bin/php-config
./configure --with-openssl --with-php-config=/usr/local/php/bin/php-config
make
sudo make install
then the openssl will install and return a path
in my computer it return /usr/local/php/lib/php/extensions/debug-zts-20160303/
finally modify php.ini and restart php-fpm :
extension_dir = "the path return after install" #you should add the return path here
extension=openssl.so

Installing xdebug in terminal

This may be a dumb question but step4 says:
The instructions should look something like:
1) Download xdebug-2.4.0.tgz (I like to use wget -O ~/downlaods/xdebug-2.4.0.tgz http://xdebug.org/files/xdebug-2.4.0.tgz on Ubuntu)
2) Unpack the downloaded file with tar -xvzf xdebug-2.4.0.tgz
3) Run: cd xdebug-2.4.0
4) Run: phpize (See the Xdebug FAQ if you don’t have phpize.)
Currently i've downloaded and unzipped it on my server following these instructions. and then it says cd into the xdebug-2.4.0 folder but what does run mean.. how do i run it? step four and five are confusing.
How do i run debug?
My output:
[~/public_html/xdebug-2.4.0]$ phpize
grep: /usr/local/include/php/main/php.h: No such file or directory
grep: /usr/local/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/local/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
I read that i have to sudo apt-get install php5-dev
but everytime i try i get this error message.
apt-get: command not found
I don't know much about what to do. I'm looking for info.
But to make apt-get work I've found those steps:
sudo su
cd /usr/ports/sysutils/apt/ && make install clean
More info here
Hope that hepls and sorry for the bad english

phpize reports "Cannot find config.m4"

I am trying to run the 'phpize' command on MacOSx Mountain Lion, but this is what I get:
Cannot find config.m4.
Make sure that you run '/opt/local/bin/phpize' in the top level source directory of the module
How do I resolve this error ?
The phpize command is meant to be run at the top level of an extension source dir (this source dir should contain a file name config.m4).
See http://php.net/manual/en/install.pecl.phpize.php for more information.
In plain English, it means you're running the command from the wrong directory. You need to be in the directory that contains the source for the extension you're trying to install.
For example, if you're trying to install mcrypt, like I was when I came across this stack overflow page, you need to be in php-5.6.24/ext/mcrypt and then run the command.
My problem was that I was trying to execute the command just to see if I had it installed.
Trying to execute the command alone gives you that error, only use it inside the directory (most likely you downloaded) that contains the extension that you're trying to install.
Here some instructions to install Xdebug for php7.2 for example.
Take special care in step 3 and 4, first you change dir to the unpacked downloaded extension and then you run phpize.
http://qiita.com/MasatoYoshioka#github/items/e542f39a6f1a3bc1f71e
In terminal
ls config.m4
ls config*
config.w32 config0.m4
cp config0.m4 config.m4
cd /usr/local/src/php-5.3.29/ext/zlib
phpize
./configure
make clean && make && make install
nano php.ini
add extension=zlib.so
got inside the xdebug folder than try to run the phpize
Sometimes, using the pecl installer is not an option. This could be because you're behind a firewall, or it could be because the extension you want to install is not available as a PECL compatible package, such as unreleased extensions from git. If you need to build such an extension, you can use the lower-level build tools to perform the build manually.
The phpize command is used to prepare the build environment for a PHP extension. In the following sample, the sources for an extension are in a directory named extname:
$ cd extname
$ phpize
$ ./configure
$ make
# make install
first run ./configure it will create config.m4 file, rest the steps are same

Categories