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

我在Ubuntu 12.04 LTS上安装Phalcon框架时出现问题</ p>

我按照在此页面中列出的说明</ a > </ p>

它说你必须在php.ini </ p>

中添加扩展名,当我在终端中创建“locate php.ini”时,5 目录已经出现,我在上面的三个目录中放置了“extension = phalcon.so”</ code>的扩展名(参见附图)。</ p>

< img src =“https://i.stack.imgur.com/yNW67.png”alt =“在此处输入图像说明”> </ p>

到目前为止它无法正常工作,因为 我在localhost网页中打开 phpinfo()</ code>,没有出现phalcon。</ p>

btw我使用xampp服务器</ p>

任何想法?!</ p>
</ div>

展开原文

原文

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个回答

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!

dongxi0523
dongxi0523 我认为该问题的解决方案是你告诉我在./install文件中编辑的行,因为我之前做了多次步骤2 - > 5并且它不起作用
6 年多之前 回复
dongyun51582
dongyun51582 在第1部分中,当我写sudo时,它给了我“Build Succeed”./install not sudo ./install --with-php-config = / opt / lampp / bin / php-config ......但是 按照步骤2,3,4和5 .....它终于有效!! :) Yesssss,谢谢你的帮助Hiro,你很棒:) :)
6 年多之前 回复



这是花了一些时间后对我有用的。 </ p>

在安装文件中cphalcon / build / install </ p>

我已经更改</ p>

  phpize  -  -clean 
</ code> </ pre>

To </ strong> </ p>

  / opt / lampp / bin / phpize  -  -clean 
</ code> </ pre>

最后一行来自</ strong> </ p>

  phpize&amp;&amp;  ./configure --enable-phalcon&amp;&amp; 制造&amp;&amp;  make install&amp;&amp;  echo -e“
感谢编译Phalcon!
建立成功:请重新启动您的Web服务器以完成安装”
</ code> </ pre>

到</ strong> < / p>

  / opt / lampp / bin / phpize&amp;&amp;  ./configure --enable-phalcon --with-php-config = / opt / lampp / bin / php-config&amp;&amp; 制造&amp;&amp;  make install&amp;&amp;  echo -e“
感谢编译Phalcon!
建立成功:请重新启动您的Web服务器以完成安装”
</ code> </ pre>

这对我有用。</ p>

</ div>

展开原文

原文

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 "
Thanks for compiling Phalcon!
Build 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 "
Thanks for compiling Phalcon!
Build succeed: Please restart your web server to complete the installation"

This worked for me.

donglue1886
donglue1886 这对我有用
5 年多之前 回复




  1. Ubuntu上XAMPP的正确php.ini位于 / opt / lampp / etc / php .ini </ code>。</ li>
  2. 在那里你必须添加这一行: extension = phalcon.so </ code>。</ li>
  3. 确保你有 您编译的.so文件位于XAMPP的PHP扩展文件夹中: / opt / lampp / lib / php / extensions </ code>。</ li>
  4. 然后您必须重新启动Web服务器。 我想你忘记了这一步。</ li>
    </ ol>
    </ div>

展开原文

原文

  1. The correct php.ini for XAMPP on Ubuntu is located at /opt/lampp/etc/php.ini.
  2. There you have to add this line: extension=phalcon.so.
  3. Make sure you have your compiled .so file in the folder for PHP extensions of XAMPP: /opt/lampp/lib/php/extensions.
  4. Then you have to restart your web server. I think you forgot this step.

dqnz43863
dqnz43863 什么说phpinfo(),你安装了PHP 5.3,5.4还是5.5? 是否还没有进入phalcon? 也许你没有正确编译phalcon.so,尝试Ubuntu sudo apt-get install git-core gcc autoconf和sudo apt-get install php5-dev php5-mysql。 然后git clone git://github.com/phalcon/cphalcon.git,cd cphalcon / build和sudo ./install。 完成这些步骤后,您应该在cphalcon文件夹中有一个正确编译的phalcon.so扩展文件。
6 年多之前 回复
duanchi3109
duanchi3109 它不起作用
6 年多之前 回复
doukong1391
doukong1391 将文件复制到该目录。
6 年多之前 回复
douou9094747
douou9094747 我该怎么做才能将.so文件放在第3步中提到的目录中。
6 年多之前 回复
dpub33855
dpub33855 我想我已经错过了第三步,在文件夹扩展中我有一些名为的文件:oci8.so,opcache.so,pgsql.so,radius.so,xdebug.so ,,,,,我没有pha​​lcon.so 在那个文件夹中
6 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问