Ошибки при компиляции PHP на CentOS x64
В данной теме я расскажу с какими ошибками при компиляции PHP на CentOS x64 можно столкнуться. Так же приведу готовые решения как решить ту или иную проблему.
Thank you for reading this post, don’t forget to subscribe!
configure: error: xml2-config not found. Please check your libxml2 installation.
configure: error: Cannot find OpenSSL’s
configure: error: Could not find pcre.h in /usr/local
configure: error: Could not find pcre.h in /usr/local
«—with-pcre-regex=/usr/include» \
configure: error: Could not find libpcre.(a|so) in /usr/include
«—with-pcre-regex=/usr» \
configure: error: Please reinstall the libcurl distribution -easy.h should be in /include/curl/
configure: error: libjpeg.(a|so) not found.
configure: error: libpng.(a|so) not found.
configure: error: freetype.h not found.
configure: error: Please reinstall the iconv library.
«—with-iconv» \
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
configure: error: Please reinstall libmhash – I cannot find mhash.h
Note that the MySQL client library is not bundled anymore!
configure: error: Please reinstall the BZip2 distribution
configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.
DISABLE IMAP
configure: error: Cannot find pspell
configure: error: Cannot find libtidy
error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
collect2: ld returned 1 exit status
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
With these build options a libphp5.so is not created and so Apache cannot use PHP .
On my CentOS 5.8 build I had to add the following configuration line to get that file created.
./configure –with-apxs2=/usr/sbin/apxs
configure: error: snmp.h not found. Check your SNMP installation.
checking for curl_multi_strerror in -lcurl… yes
checking for QDBM support… no
checking for GDBM support… no
checking for NDBM support… no
configure: error: DBA : Could not find necessary header file(s).
Для тех кто хочет быстро исправить все проблемы, попробуйте запустить так:
# yum install glibc-utils.x86_64 libtool-ltdl-devel.x86_64 libxslt.x86_64 libxslt-devel.x86_64 libtidy.x86_64 libtidy-devel.x86_64 aspell-devel.x86_64 bzip2-devel.x86_64 php-mysql.x86_64 mysql-devel.x86_64 mhash.x86_64 mhash-devel.x86_64 libmcrypt.x86_64 libmcrypt-devel.x86_64 freetype-devel.x86_64 libpng-devel.x86_64 libjpeg-devel.x86_64 curl-devel.x86_64 openssl-devel.x86_64 libxml2-devel.x86_64 net-snmp-devel libcurl-devel.x86_64
PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib64/php/modules/mcrypt.so’ – libmcrypt.so.4: cannot open shared object file: No such file or directory in Unknown on line 0
I created some script in php, encrypting and decrypting my emails. but when I ran the script, got some issues. When I traced it, the php-mcrypt library is missing. I am using CentOS 6.2 at 64bit architecture. Some says I will move the libmcrypt.so.4 and libmcrypt.so.4.4.8 from /usr/lib to usr/lib64 and /usr/lib/php/mcrypt.so to /usr/lib64/php/mcrypt.so but when I check the file, its not there. The files aren’t there at the installed directory. to check this issues, cast php -v;
[root@mail lib64]# php -v PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mcrypt.so' - libmcrypt.so.4: cannot open shared object file: No such file or directory in Unknown on line 0 PHP 5.3.3 (cli) (built: Feb 2 2012 23:47:49) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with the ionCube PHP Loader v4.0.10, Copyright (c) 2002-2011, by ionCube Ltd.
If there’s PHP Warning, then that means there are missing files… if more warnings, probably there’s a problem during installation of your php. But in this guide, I will only discuss how to fix the php-mcrypt issues.
First download the lacking files, which are;
You can download those files at rpmfind.net or rpm.pbone.net. Then extract the files inside the rpm pack by using the command rpm2cpio.
[root@mail ~]# rpm2cpio libmcrypt-2.5.8-4.el5.centos.x86_64.rpm | cpio -idmv [root@mail ~]# rpm2cpio php-mcrypt-5.3.3-1.el6.x86_64.rpm | cpio -idmv
Then move the files that you just extracted to /usr/lib64 and after moving the files, restart httpd and cast again the php -v.
[root@mail ~]# php -v PHP 5.3.3 (cli) (built: Feb 2 2012 23:47:49) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with the ionCube PHP Loader v4.0.10, Copyright (c) 2002-2011, by ionCube Ltd. [root@mail ~]#
This is the output you should get, no PHP Warnings and php-mcrypt should be working fine. That’s it! Happy solving!
установка php 5.4 на slackware 13.37 x64
а как можно создавать пакеты, чтобы не захламлять систему? т.е. я установил netbeans он лег в /usr/local но запускать его из консоли и держать ее открытой, пока работаю в netbens неудобно, тоже самое и со skype, filezilla. Может вы подскажите? p.s. понимаю что не потеме, но все же)
а как можно создавать пакеты, чтобы не захламлять систему?
Традиционным для Slackware способом — через скрипты сборки пакетов — слакбилды. Часто мы не являемся первопроходцами и кто-то до нас уже нечто подобное делал. Неплохой сборник подобных рецептов — slackbuilds.org.
ps. Примерный порядок сборки со slackbuilds.org описывал буквально вчера тут: не запускается vuze 4.7 (комментарий)
> а как можно создавать пакеты, чтобы не захламлять систему?
слакбилды писать 🙂 посмотри скрипты *.SlackBuild в /source/ для примеров.
> т.е. я установил netbeans он лег в /usr/local но запускать его из консоли и держать ее открытой, пока работаю в netbens неудобно
нетбинз кидает в /usr/share/applications/ свой *.desktop-файл, так что его можно запускать с меню или по Alt+F2 под кедами. кроме того, нетбинз генерит uninstall.sh в директории установки, который его может нормально удалить (кроме кэшей в хомяке, которые придётся чистить вручную).
с остальным не знаю, не использую.