dongxiandi8313 2014-02-10 20:20 采纳率: 100%
浏览 69
已采纳

使用XAMPP服务器在ubuntu 12.04 LTS上安装Phalcon

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).

enter image description here

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 ?!

  • 写回答

3条回答 默认 最新

  • dongya2029 2014-02-11 20:29
    关注

    Probably version or configuration difference between your machine's PHP and XAMPP's PHP

    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!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘