PHP 5.4安装后:preg_match():编译失败:未知选项位设置在偏移0 [英] PHP 5.4 after-install: preg_match(): Compilation failed: unknown option bit(s) set at offset 0

查看:141
本文介绍了PHP 5.4安装后:preg_match():编译失败:未知选项位设置在偏移0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将我的PHP升级到版本5.4.1在我的狮子OS X 64位,我收到错误抛出在Codeigniter:

I recently upgraded my PHP to version 5.4.1 on my Lion OS X 64bit, I'm getting an error thrown in Codeigniter:

Severity: Warning

Message: preg_match(): Compilation failed: unknown option bit(s) set at offset 0

Filename: core/Utf8.php

Line Number: 44

我Googled的问题,这似乎是一个在PHP中的PCRE lib的问题,我遵循了这个教程显示安装pcre与我做的homebrew(我运行pcre 8.30),这没有解决问题。

I Googled the problem, this seems to be a problem with the PCRE lib in PHP, well I followed this tutorial which shows to install pcre with homebrew which I did (I'm running pcre 8.30) and this didn't solve the problem.

但我没有遇到一个帮助 - 是否有一个修复这个PCRE lib问题的方法?

I've tried looking around for solutions, but I haven't came across one that helped - is there a method of fixing this PCRE lib problem?

编辑:只是编辑了这个问题提醒我的安装是什么:

Just edited this question to remind me what my installation was:

./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/private/etc \
--with-apxs2=/usr/sbin/apxs \
--enable-cli \
--with-config-file-path=/etc \
--with-libxml-dir=/usr \
--with-openssl=/usr \
--with-kerberos=/usr \
--with-zlib=/usr \
--enable-bcmath \
--with-bz2=/usr \
--enable-calendar \
--with-curl=/usr \
--enable-dba \
--enable-exif \
--enable-ftp \
--with-gd \
--with-freetype-dir=/usr/X11/ \
--with-jpeg-dir=/usr \
--with-png-dir=/usr/X11/ \
--enable-gd-native-ttf \
--with-icu-dir=/usr \
--with-iodbc=/usr \
--with-ldap=/usr \
--with-ldap-sasl=/usr \
--with-libedit=/usr \
--enable-mbstring \
--enable-mbregex \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysql-sock=/var/mysql/mysql.sock \
--with-readline=/usr \
--enable-shmop \
--with-snmp=/usr \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--with-tidy \
--enable-wddx \
--with-xmlrpc \
--with-iconv-dir=/usr \
--with-xsl=/usr \
--enable-zip \
--with-pgsql=/usr \
--with-pdo-pgsql=/usr \
--with-mcrypt=/usr/local/lib


推荐答案

我能够得到PHP 5.4.1与PCRE版本8.12(这是包括在PHP 5.4.1版本我相信)。在所有的问题的评论中列出的所有来回,我决定编译PHP没有PCRE标志,让PHP只是使用它的默认值。通过使用默认值,它用8.12编译。

I was able to get PHP 5.4.1 working with PCRE version 8.12 (which is the version included in PHP 5.4.1 I believe). After all the back and forth listed in the question's comments, I decided to compile PHP without the PCRE flags and let PHP just use it's defaults. By using the defaults, it compiles with 8.12.

现在,后续问题是,当然,为什么会发生这种情况。我仍然希望8.30编译PHP与我提供的标志。但是,在这一点上,我只是很高兴有这个工作。

Now, a follow up questions is, of course, WHY this happens. I would still expect 8.30 to be compiled with PHP with the flags I provided. But, at this point, I am just happy to have the thing working.

以下是我的工作配置选项,如果你想尝试从你的结束。

Below are the config options I got to work in case you want to try it from your end.

./configure \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/private/etc \
--with-apxs2=/usr/local/apache/bin/apxs \
--enable-cli \
--with-config-file-path=/etc \
--with-libxml-dir=/usr \
--with-openssl=/usr \
--with-kerberos=/usr \
--with-zlib=/usr \
--enable-bcmath \
--with-bz2=/usr \
--enable-calendar \
--with-curl=/usr \
--enable-dba \
--enable-exif \
--enable-ftp \
--with-gd \
--with-freetype-dir=/usr/X11/ \
--with-jpeg-dir=/usr \
--with-png-dir=/usr/X11/ \
--enable-gd-native-ttf \
--with-icu-dir=/usr \
--with-iodbc=/usr \
--with-ldap=/usr \
--with-ldap-sasl=/usr \
--with-libedit=/usr \
--enable-mbstring \
--enable-mbregex \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysql-sock=/var/mysql/mysql.sock \
--with-readline=/usr \
--enable-shmop \
--with-snmp=/usr \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--with-tidy \
--enable-wddx \
--with-xmlrpc \
--with-iconv-dir=/usr \
--with-xsl=/usr \
--enable-zip \
--with-pgsql=/usr \
--with-pdo-pgsql=/usr \
--with-mcrypt=/usr

这篇关于PHP 5.4安装后:preg_match():编译失败:未知选项位设置在偏移0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆