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 /
Related
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.
I am a new programmer and I need your help.
I'm pretty much new to Atom editor, but setup some nice packages like Atom Beautify. After using it in a html / php file I'm getting the error "Could not find 'php-cs-fixer' . The program may not be installed. The strange thing is, I did install the package php-cs-fixer but nothing happens.
My system is Windows.
Anyone got an idea how I can fix this?
You must have installed "php" usually when installing the Wamp or Xampp servers are installed by default.
Download the file "php-cs-fixer.phar" https://github.com/FriendsOfPHP/PHP-CS-Fixer
In the CMD execute this command: php where.exe
You get a path, that path copy in: Open Atom Packages / Atom Beautify / Settings / Executables / PHP
In the same folder where the php.exe is located copy the file "php-cs-fixer.phar"
Redo the previous process with the CMD and the Atom in PHP-CS-Fixer "
Just run this command in terminal, then it will work perfectly:
$ composer global require friendsofphp/php-cs-fixer
Everything will be fixed!
I am not sure about in Windows, but on Mac and Linux, I do the following. You may be able to do this with Git Bash in Windows.
Install php-cs-fixer with Homebrew (via PHP-CS-Fixer Instructions)
brew install php-cs-fixer
Confirm php-cs-fixer was installed
which php-cs-fixer
its because you need to install php cs fixer, the atom extension is trying to use it but its not currently installed on your system, install it here:
https://github.com/FriendsOfPHP/PHP-CS-Fixer
I suggest you install manually the php-cs-fixer using the following steps:
You can use yum, apt, and other methods of installing a software or a .exe for windows
Get the path to the installed binary, for example for me i checked using whereis php-cs-fixer and I got /usr/bin/php-cs-fixer
Go to Packages > Atom Beautify > Settings > Executables > PHP-CS-FIXER then in the Binary/Script Path give the path of the php-cs-fixer above (/usr/bin/php-cs-fixer)
Enjoy beautify.
The issue for me was originally installing with composer. Composer does not put a .phar file into the /bin folder.
Download the .phar file (https://github.com/FriendsOfPHP/PHP-CS-Fixer#locally) and place it somewhere explicitly, then put that location in settings->executables->PHP-CS-Fixer path
The manual way did work for me and this how I went about it;
I download php-cs-fixer manually.
$ wget https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer
or with curl
$ curl -L https://cs.symfony.com/download/php-cs-fixer-v3.phar -o php-cs-fixer
Then I fixed the rights and moved it to the right directory.
$ sudo chmod a+x php-cs-fixer
$ sudo mv php-cs-fixer /usr/local/bin/php-cs-fixer
Finally, I ran php-cs-fixer and it worked.
full link
make an empty folder somewhere. example: C:\Programs\php-cs-fixer
run composer require friendsofphp/php-cs-fixer
open atom and go to
settings -> packages -> atom beautify -> settings -> executables ->
php cs fixer input the path there:
C:\Programs\php-cs-fixer\vendor\bin\php-cs-fixer.bat
optionally:
add C:\Programs\php-cs-fixer\vendor\bin to windows env path so you
can use it from cli
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
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
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