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 ELGamal和paillier计算效率谁快?
  • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
  • ¥15 ubuntu系统下挂载磁盘上执行./提示权限不够
  • ¥15 Arcgis相交分析无法绘制一个或多个图形
  • ¥15 关于#r语言#的问题:差异分析前数据准备,报错Error in data[, sampleName1] : subscript out of bounds请问怎么解决呀以下是全部代码:
  • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
  • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
  • ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误
  • ¥30 3天&7天&&15天&销量如何统计同一行