编译带扩展的 PHP

发布于 2024-10-15 16:50:24 字数 822 浏览 5 评论 0原文

谁能告诉我为什么以下 ./configure 设置似乎并没有真正影响我的 PHP 构建?

详细信息:

  • php-5.3.5
  • 编译以便在每个域的基础上使用 php-cgi

例如,我的 ./configure 如下所示:

./configure --with-curl --enable-mbstring

make、make install 工作正常,并且我成功获得了我的 php-cgi 二进制文件。当我运行时:

<?php phpinfo() ?>

我可以看到我运行的是5.3.5,但是没有curlmbstring的迹象。

但是,有一个问题:如果我直接在扩展上使用 run phpize (在源代码中)并执行适当的 ./configure, make, make install,我可以添加:

extension=mbstring.so

到我的 php.ini 中,然后我在 phpinfo() 输出中看到 mbstring

我由此推测,我可以付出额外的努力来手动编译我想要的每个扩展,但我无法直接编译扩展。

有什么想法吗?

Can anyone give me any pointers on why the following ./configure settings do not appear to actually affect my build of PHP?

Details:

  • php-5.3.5
  • Compiling in order to use php-cgi on a per-domain basis

For example, my ./configure looks like this:

./configure --with-curl --enable-mbstring

The make, make install works fine, and I successfully get my php-cgi binary. When I run:

<?php phpinfo() ?>

I can see that I am running 5.3.5, but there is no sign of curl or mbstring.

However, there is a catch: If I use run phpize on the extension directly (in the source) and go through a proper ./configure, make, make install, I can add:

extension=mbstring.so

to my php.ini and then I see mbstring in my phpinfo() output.

What I surmise from this is that I can put in the extra effort to manually compile each and every extension I want, but I cannot get the extensions to compile in directly.

Any thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

像你 2024-10-22 16:50:24

ajreal 的评论为我指明了正确的方向。

我同时尝试了几件事,最终交叉了几根电线。我没有成功创建到 php-cgi 二进制文件的符号链接,因此它已被复制到:

/var/www/vhost/DOMAIN/bin.

它仍然指向正确的 php.ini,但与我的二进制文件不同后来用附加扩展进行了编译。

现在可以理解为什么 php.ini 中添加的模块出现但没有直接编译了。吸取教训!

ajreal's comment pointed me in the right direction.

I was trying a few things all at the same time and ended up crossing a few wires. I was not successful at creating a symbolic link to the php-cgi binary, so it had been copied to:

/var/www/vhost/DOMAIN/bin.

It was still pointing to the correct php.ini, but was not the same binary as what I had later compiled with the additional extensions.

Now it makes sense why modules added in the php.ini showed up but were not directly compiled in. Lesson learned!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文