环境
- Ubuntu 23.04 x86_64
- php7.4.33
查看ubuntu版本
lsb_release -a
查看php版本
php -v
查看php扩展
php -m
错误提示&解决方法
xml2-config not found. Please check your libxml2 installation.
sudo apt-get install libxml2-dev
Cannot find OpenSSL’s <evp.h>
sudo apt-get install libcurl4-openssl-dev
Please reinstall the BZip2 distribution
sudo apt-get install libbz2-dev
Cannot find enchant
sudo apt-get install libenchant-dev
png.h not found.
sudo apt-get install libpng12-dev
Unable to locate gmp.h
sudo apt-get install libgmp-dev
utf8_mime2text() has new signature, but U8T_CANONICAL is missing
sudo apt-get install libc-client2007e-dev
libgds, libib_util or libfbclient not found!
sudo apt-get install firebird2.5-dev
Unable to detect ICU prefix or no failed
sudo apt-get install libicu-dev
cannot find ldap libraries in /usr/lib
sudo apt-get install libldap2-dev
sudo ln -fs /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/
mcrypt.h not found. Please reinstall libmcrypt.
sudo apt-get install libmcrypt-dev
Cannot find FreeTDS in known installation directories
sudo apt-get install freetds-dev
Could not find /usr/lib/libsybdb.a|so
sudo ln -fs /usr/lib/x86_64-linux-gnu/libsybdb.so /usr/lib/
运行程序查询sqlserver数据中文乱码解决
whereis freetds.conf
我的配置在 /etc/freetds
vi /etc/freetds/freetds.conf
然后在global下添加:
client charset = utf8
Oracle Instant Client directory /usr/lib/oracle/…/client64/lib libraries not found
安装oracle扩展
禁用oracle扩展 –without-oci8 –without-pdo_oci
cannot stat ‘/usr/local/lib/odbclib.a’: No such file or directory
sudo apt-get install unixodbc-dev
sudo ln -fs /usr/lib/x86_64-linux-gnu/libodbc.a /usr/local/lib/odbclib.a
ODBC header file ‘/usr/local/incl/sqlext.h’ not found!
sudo apt-get install unixodbc-dev
sudo mkdir /usr/local/incl
sudo cp /usr/include/sqlext.h /usr/local/incl/
Cannot find pspell
sudo apt-get install libpspell-dev
Please reinstall libedit - I cannot find readline
sudo apt-get install libedit-dev
Can not find recode.h anywhere under yes /usr/local /usr /opt
sudo apt-get install librecode-dev
Cannot find libtidy
sudo apt-get install libtidy-dev
xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
sudo apt-get install libxslt1-dev
ctpublic.h missing!
sudo apt-get install freetds-dev
--with-sybase-ct=shared,/usr
docker中安装php扩展
docker exec -it php7.4 bash
docker-php-ext-install pdo_mysql
apt update
apt install -y libwebp-dev libjpeg-dev libpng-dev libfreetype6-dev
cd /usr/src/
tar -xf php.tar.xz
安gd库(后面参数可能会报错,去掉也能安装)
cd /usr/src/php-7.4.33/ext/gd
docker-php-ext-configure gd --with-webp-dir=/usr/include/webp --with-jpeg-dir=/usr/include --with-png-dir=/usr/include
docker-php-ext-install gd
安装 pdo_dblib
cd /usr/src/php-7.4.33/ext/pdo_dblib
docker-php-ext-configure pdo_dblib
docker-php-ext-install pdo_dblib
ctrl +q +p
docker restart php7.4