3

I wanted to test the php-cpp possibilities but while using "make" it throughs "php.h" missing at me:

g++ -Wall -c -g -std=c++11 -fpic `php-config --includes` -o zend/base.o zend/base.cpp
In file included from zend/base.cpp:8:
zend/includes.h:35:10: fatal error: 'php.h' file not found
#include <php.h>
         ^
1 error generated.
make: *** [zend/base.o] Error 1

How can I fix it? I`m on osx10.9.3 and if it's relevant I'm using xampp for php projects. The documentation of php-cpp http://www.php-cpp.com/documentation/install.

3
  • Make sure php.h is where it's supposed to be Commented Jul 1, 2014 at 0:42
  • @ElefantPhace do I have to download the whole php library for this? Just downloaded the php src and I'm adding missing file but right now it says zend/includes.h:35:10: error: 'php.h' file not found with <angled> include; use "quotes" instead #include <php.h> Commented Jul 1, 2014 at 0:53
  • 1
    Oke, apparently what you need to do is download the php source from: - nl3.php.net/downloads.php Copy the "zend" folder from the package and paste it to the php-cpp folder (delete the old one and rename the new one to "zend"). Commented Jul 1, 2014 at 1:05

2 Answers 2

3

Oke, apparently what you need to do is download the php source from: - nl3.php.net/downloads.php Copy the "zend" folder from the package and paste it to the php-cpp folder (delete the old one and rename the new one to "zend").

Sign up to request clarification or add additional context in comments.

Comments

1

First check if your "php" package is installed ... if not please install it.

Now get your php version with "$php -v" then maybe the "php.h" it already in your "php/main/" folder "/usr/include/php/main/" and put the "php.h" from there in the "usr/include/" directory.

If you cant find the "php.h" file there - Just download the php sourcecode from github but you have to notice that you download the version which is similar to yours "$php -v".

Here go to the "main" directory in the php sourecode. There the is the "php.h" file located - now just put it in your "usr/include/" path.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.