PPC64 schema on the source code compiled PHP

Source: Internet
Author: User

The company has a total of dozens of servers, has set up a cacti integrated Nagios architecture Monitoring system, in order to compare the accuracy of monitoring data, ready to build Zabbix monitoring platform. The server is not much free, and several virtual machines are virtualized on a single IBM machine, using one of the virtual machines to build the Zabbix monitoring platform.

According to the method of building Zabbix, using the way RPM package everyone loves you lamp platform, download from the Internet Php-bcmath and php-mbstring RPM package installation, the error prompts, the hint is the system architecture is different, using the command uname-m view the hardware architecture of the machine, The output is not well-known x86_64, x64, but PPC64, because the Php-bcmath and php-mbstring used are under the x86_64 platform. Online in the RPM package site search, have not found the appropriate version, decided to use the PHP source package installation, and Apache and MySQL keep using the system's own RPM package.


Operating system: RedHat 6.4

PHP Version: php-5.4.19.tar.gz

Packages used: fontconfig-2.4.2.tar.gz, freetype-2.3.5.tar.gz, gd-2.0.33.tar.gz, jpegsrc.v6b.tar.gz, libpng-1.2.18.tar.gz, Libxml2-2.6.32.tar.gz, zlib-1.2.3.tar.gz


First, install the PHP front-facing package, support GD Library

1, installation Zlib

Tar zlib-1.2.3.tar.gz

CD zlib-1.2.3

Cflags= "-o3-fpic"./configure//One-line command, must be compiled with the previous compilation environment parameters, or error

Make

Make install


2, installation libpng

Tar zxvf Libpng-1.2.18.tar.tar

CD libpng-1.2.18

./configure--prefix=/usr/local/libpng

Make

Make install


3. Install JPEG

Mkdir/usr/local/jpeg

Mkdir/usr/local/jpeg/bin

Mkdir/usr/local/jpeg/lib

Mkdir/usr/local/jpeg/include

Mkdir/usr/local/jpeg/man

Mkdir/usr/local/jpeg/man/man1

Tar zxf jpegsrc.v6b.tar.gz

CD jpeg-6b

./configure--prefix=/usr/local/jpeg--enable-shared--enable-static

Make

Make install


Make may error

./libtool--mode=compile gcc-o2-i. C./jcapimin.c

Make:./libtool: Command not found

Make: * * [Jcapimin.lo] Error 127

Workaround:

First see if there are any installation and Libtool-ltdl-devel

Rpm-qa | grep Libtool


There is a network Yum source directly with Yum installation yum-y install Libtool-ltdl-devel, no network yum source, because the system comes with the RPM package does not have this package, the use of source installation method:

Tar zxf libtool-2.2.6a.tar.gz

CD libtool-2.2.6

./configure

Make

Make install


Then go to the jpeg-6b source directory, and then perform the following steps, remember! Copy to current directory note the following point (.)


Cp/usr/local/share/libtool/config/config.sub.

Cp/usr/local/share/libtool/config/config.guess.


That is, two configuration files in config to overwrite the corresponding files in the jpeg-6b directory.

Make clean and re-configure

If you don't have permission, create the corresponding folder and make the install again.


4, Installation FreeType

Tar zxvf freetype-2.3.5.tar.gz

CD freetype-2.3.5

./configure--prefix=/usr/local/freetype

Make

Make install


5, installation LIBXML2

TAR–ZXVF libxml2-2.6.32.tar.gz

CD libxml2-2.6.32

./configure

Make

Make install


6, Installation Fontconfig

Vim/etc/profile

Export Pkg_config_path=/usr/local/lib/pkgconfig: $PKG _config_path

Source/etc/profile

TAR-ZXVF fontconfig-2.4.2.tar.gz

CD fontconfig-2.4.2

./configure--with-freetype-config=/usr/local/freetype/bin/freetype-config

Make

Make install


6. Installing GD

TAR-ZXVF gd-2.0.34.tar.gz

CD gd-2.0.34

./configure--with-png=/usr/local/libpng/--with-freetype=/usr/local/freetype/--with-jpeg=/usr/local/jpeg/


Must be shown to be this information:

* * Configuration Summary for GD 2.0.33:


Support for PNG Library:yes

Support for JPEG Library:yes

Support for Freetype 2.x Library:yes

Support for Fontconfig Library:yes

Support for XPM Library:no

Support for Pthreads:yes


Make

Make install


Make error shows libpng.h header file not found

Method:

Workaround:

VI gd_png.c

Will

#include "Png.h"

Replace with:

#include "/usr/local/libpng/include/png.h"

And then make it.


Second, install PHP

1, in order to be the source package installed PHP can adapt to the RPM package installed Apache and MySQL, using the RPM installation lamp platform, and then get the PHP compiler parameters method.

Yum-y install httpd mysql-server mysql php php-mysql php-pdo

Then start Apache and MySQL, create a. php suffix file in the HTML directory, and write the following:

<?php

Phpinfo ();

?>

Enter the Http://IP address/file name on the appropriate machine, copy the configuration information in the Config bar according to the output PHP information, and note that the quotation marks are removed. Depending on the configuration commands supported by the version and your own needs, the configuration parameters are overwritten, so the next step is done directly because the modifications have been made.


2. Install PHP

Yum-y Install httpd mysql-server mysql

Tar zxf php-5.4.19.tar.gz-c/usr/src/

cd/usr/src/php-5.4.19/


php Compiler parameters:

./configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php--disable-debug--with-pic-- Disable-rpath--without-pear--with-bz2--enable-gd-native-ttf--without-gdbm--with-gettext--with-gmp--with-iconv- -with-openssl--with-zlib--enable-exif--enable-ftp--enable-sockets--enable-sysvsem--ENABLE-SYSVSHM-- Enable-sysvmsg--with-kerberos--enable-shmop--enable-calendar--enable-xml--with-apxs2=/usr/sbin/apxs-- Without-mysql--without-gd--disable-dom--disable-dba--without-unixodbc--enable-pdo--disable-xmlreader-- Disable-xmlwriter--disable-phar--disable-fileinfo--disable-json--without-pspell--disable-wddx--without-curl-- Disable-posix--disable-sysvmsg--disable-sysvshm--disable-sysvsem--enable-mbstring--enable-bcmath--with-mysql= Mysqlnd--with-pdo-mysql=mysqlnd--with-mysqli=mysqlnd  --with-gd=/usr/local/--enable-gd-native-ttf-- Enable-gd-jis-conv--with-freetype-dir=/usr/local/freetype--with-jpeg-dir=/usr/local/jpeg--with-png-dir=/usr/ local/Libpng--with-zlib-dir=/usr/local/--enable-xmlwriter--enable-xmlreader


Configure the error that occurred:

./configure:line 8410:/usr/sbin/apxs:no such file or directory

Yum Install-y httpd-devel


Configure:error:Cannot find OpenSSL ' s <evp.h>

Yum-y Install Openssl-devel


Onfigure:error:Please Reinstall the BZIP2 distribution

Yum Install Bzip2-devel


Configure:error:Unable to locate Gmp.h

Yum Install Gmp-devel


Make

Make install


Make when version 5.4 has a bug:

/USR/SRC/PHP-5.4.19/EXT/GD/GD_CTX.C: In the function ' _php_image_stream_ctxfree ':

/USR/SRC/PHP-5.4.19/EXT/GD/GD_CTX.C:67: Error: ' struct Gdioctx ' does not have a member named ' Data '

/USR/SRC/PHP-5.4.19/EXT/GD/GD_CTX.C:68: Error: ' struct Gdioctx ' does not have a member named ' Data '

/USR/SRC/PHP-5.4.19/EXT/GD/GD_CTX.C:69: Error: ' struct Gdioctx ' does not have a member named ' Data '

In file included from/usr/src/php-5.4.19/ext/gd/gd.c:103:

/USR/SRC/PHP-5.4.19/EXT/GD/GD_CTX.C: In the function ' _php_image_output_ctx ':

/usr/src/php-5.4.19/ext/gd/gd_ctx.c:153: Error: ' Gdioctx ' does not have a member named ' Data '

Make: * * [Ext/gd/gd.lo] Error 1

Repair:

Vim/usr/local/include/gd_io.h


/* Seek must return 1 on SUCCESS, 0 on FAILURE. Unlike fseek! */

Int (*seek) (struct gdioctx *, const int);


Long (*tell) (struct gdioctx *);


void (*gd_free) (struct gdioctx *);

void (*data);//Add this sentence


}

Gdioctx;


Add this command for ease of use after installing PHP:

ln–s/usr/local/php/bin/*/usr/local/bin/


3, configure Apache, and start Apache, MySQL

Vim/etc/httpd/conf/httpd.conf

AddHandler php5-script. php

AddType text/html. php

DirectoryIndex index.php


Service httpd Start

Service mysqld Start

Chkconfig--level httpd on

Chkconfig--level mysqld on


4. Test PHP

vim/var/www/html/test1.php

<?php

Phpinfo ();

?>

Output PHP 5.4, indicating that PHP 5.4 can be called by Apache


vim/var/www/html/test2.php

<?php

$link =mysql_connect (' 127.0.0.1 ', ' Test ', ');

if ($link) echo "Congratulations, the database connection is successful!!";

Mysql_close ();

However, after replacing the 127.0.0.1 with localhost, the database failed to connect and no solution was found.



So the lamp platform is set up, the solution of the RPM package to install PHP is missing the necessary main parts, you can safely install Zabbix software.


This article is from the "Fog" blog, please be sure to keep this source http://chenlz.blog.51cto.com/5069563/1585280

PPC64 schema on the source code compiled PHP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.