Php

PECL 安裝/phpize 錯誤

  • May 16, 2020

這是我的 PHP 設置

##################################################################
# setup PHP
##################################################################

# we use this to make inline CSS in newsletter
yum install php php-tidy php-xml php-xmlrpc php-gd -y

# if make is missing
yum install gcc automake autoconf libtool make -y

# configuring php pecl http
yum install zlib-devel curl-devel php-devel php-pear -y

# required by phpMyAdmin
yum install php-mcrypt php-mbstring php-bcmath pcre -y

pecl channel-update pecl.php.net
pecl upgrade

pecl install bbcode
pecl install pecl_http
pecl install apc
pecl install oauth

# add to /etc/php.ini

extension=bbcode.so
extension=http.so
extension=apc.so
extension=oauth.so

apc.shm_size="128MB"

不幸的是,當我跑步時

pecl install oauth

我得到:

[root@server ~]# pecl install oauth
downloading oauth-1.1.0.tgz ...
Starting to download oauth-1.1.0.tgz (44,731 bytes)
............done: 44,731 bytes
6 source files, building
ERROR: could not chdir to /var/tmp/oauth/examples

好吧,假設我創建了目錄。

[root@server ~]# mkdir /var/tmp/oauth
[root@server ~]# mkdir /var/tmp/oauth/examples
[root@server ~]# pecl install oauth
downloading oauth-1.1.0.tgz ...
Starting to download oauth-1.1.0.tgz (44,731 bytes)
............done: 44,731 bytes
6 source files, building
running: phpize
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module

ERROR: `phpize' failed
[root@server ~]# 

呃。我放棄了這個。過去幾個小時一直在嘗試修復它。

更多資訊。

[root@server ~]# phpize -v
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626

[root@server ~]# find / -name "config.m4"
[root@server ~]# 

這實際上是一個 PECL 錯誤。( http://pecl.php.net/bugs/bug.php?id=16746 )

解決方案在 PECL 頁面上給出。

手動下載您要查找的庫,例如PDO_MYSQL-1.0.2.tgz. 解壓它並進入目錄 PD0_MYSQL-1.0.2。執行phpize。它將被安裝。

引用自:https://serverfault.com/questions/279931