We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Can't find PHP headers in /usr/include/php/x.x.xx/php

Hi Guys, i have been trying to get phalcon to install on AWS linux using Putty. What i did was i downloaded and uploaded the files from git://github.com/phalcon to /var/www/html directory and using Putty i tried the following installation steps.

cd cphalcon/build sudo ./install

Unfortunately, i get the following error.

Can't find PHP headers in /usr/include/php/5.6/php The php-devel package is required for use of this command.

What should i do?

P.S. I have installed LAMP server on AWS by following https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html link. Thus i have php 5.6.14.



58.4k

Hey

You need to install php-dev for it, you can take look at https://serverfault.com/questions/617472/trying-to-install-php-devel-on-aws-ec2-server-to-compile-a-php-extension-but-ge after that you try agian install Phalcon PHP

Hey,

I managed to get through but now i get the following error when i type "php -m | grep phalcon"

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/5.6/modules/phalcon.so' - /usr/lib64/php/5.6/modules/phalcon.so: undefined symbol: php_pdo_get_dbh_ce in Unknown on line 0 phalcon

Any idea why?

P.S. Oh when i checked the phpinfo, phalcon is listed and it shows Web framework delivered as a C-extension for PHP, author version and build dates. HELP!



43.9k
Accepted
answer

Hi,

usually, this error message means that phalcon's php extension is loaded before all other pdo extensions. I do not know AWS, but it looks like a cloud service provider where you can install instance running a linux distribution.

How to solve that with a debian distribution :

in /etc/php5/apache2/conf.d/ and /etc/php5/cli/conf.d/ create a file 60-phalcon.ini with extension=phalcon.so in it and remove that instruction from php.ini

edited Jan '16

This is Linux and i have installed LAMP.

Strangely i cannot find where conf.d in apache2 and cli directories. Why is it that /etc/apache2 directory does not exist.

Is this because i installed LAMP and i have httpd.conf? This isnt clear. Help me out.



43.9k

Hi,

What kind of linux distribution are you running ?

I think i managed to get Phalcon working :) thank you very much guys.

To test this, i have hosted a phalcon project but only problem is that i have to append "/public" to the domain so then only would it will load the index controller? Any idea how we can achieve this via the .htaccess file outside the public folder? or any other way?

Thanks a lot for the help guys :)