Reputation: 599
I have a problem in the installation of Phalcon framework on Ubuntu 12.04 LTS
I followed the instruction listed in this page
It says that you must add the extension in php.ini
and when I made "locate php.ini" in my terminal, 5 directories had been appeared and I put
the extension which is "extension=phalcon.so"
in the upper three directories (See the attached picture).
It doesn't work up till now because when I open phpinfo()
in the localhost web page, phalcon doesn't appear.
btw I use xampp server
any ideas ?!
Upvotes: 1
Views: 4653
Reputation: 182
This is what worked for me after spending some time.
In install file cphalcon/build/install
i've change
phpize --clean
To
/opt/lampp/bin/phpize --clean
And the last line From
phpize && ./configure --enable-phalcon && make && make install && echo -e "\nThanks for compiling Phalcon!\nBuild succeed: Please restart your web server to complete the installation"
To
/opt/lampp/bin/phpize && ./configure --enable-phalcon --with-php-config=/opt/lampp/bin/php-config && make && make install && echo -e "\nThanks for compiling Phalcon!\nBuild succeed: Please restart your web server to complete the installation"
This worked for me.
Upvotes: 1
Reputation: 376
If you are trying to use Phalcon with XAMPP, you might have some compilation issues. When compiling Phalcon, the default code uses your machine's php scripts to run the function phpize instead of the XAMPP's php scripts. Then, when you just compile and add the .so to XAMPP, it will try to use an extension built from a different PHP version or configuration. Of course that error only occurs when your Ubuntu PHP version or configuration is different from your XAMPP php version.
So, to correct this add an extra argument on Phalcon compilation as follows:
###Part 1###
$git clone git://github.com/phalcon/cphalcon.git
$cd cphalcon/build
$sudo ./install --with-php-config=/opt/lampp/bin/php-config
We added the argument --with-php-config= which will say what php configuration should be used. After running the ./install, you should see in your terminal the message "Thanks for compiling Phalcon!
Build succeed: Please restart your web server to complete the installation". If that doesnt happen, it means that the pahlcon.so was not generated correctly. If that happens, open the ./install file and replace all phpize occurrence for phpize --with-php-config=/opt/lampp/bin/php-config. There are two occurences, one in line 59 and other in line 63. Also replace the ./configure --enable-phalcon for ./configure --enable-phalcon --with-php-config=/opt/lampp/bin/php-config on line 63. After that run again the command $ sudo ./install --with-php-config=/opt/lampp/bin/php-config and check if you see the message "Thanks for compiling Phalcon!
Build succeed: Please restart your web server to complete the installation"
After that, continue the process normally:
###Part 2###
$vi /opt/lampp/etc/php.ini
In the open file press key ":" then type "1000" then press enter key. that should take you to the 1000 line of the file, around where the etension=xxxx.so are. If not, press down arrow until you find this area. something like this:
##Part 3##
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_exif.dll
;extension=php_fileinfo.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_ming.dll
;extension=php_mssql.dll
When your cursor is somewhere like that, press "i" for insertion mode and add the line:
##part 4##
extension=phalcon.so
Attention, don't put a ";" before, that means it is a commented line. After that save the file by pressing ":" after that press "x" then push enter. That menas you saved the file.
Then, finally restart your webserver by using the command:
##part 5##
$sudo /opt/lampp/lampp restart
By now, everything is gret to go. Hope it helps!
Upvotes: 5
Reputation: 689
/opt/lampp/etc/php.ini
.extension=phalcon.so
./opt/lampp/lib/php/extensions
.Upvotes: 0