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 求差集那个函数有问题,有无佬可以解决
  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题