LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-06-2016, 10:51 AM   #1
Tadeh
LQ Newbie
 
Registered: Jan 2016
Posts: 2

Rep: Reputation: Disabled
Installing PHP 7.0.2RC1 from source code for CentOS 7, Later rpm for other users in repository


Hello everybody,

I am trying to bring PHP 7.0.2 for you. Please help me finish this project here together.

I found two tutorials on how to install PHP from source codes in these 2 locations;

http://www.tecmint.com/install-and-c...-and-debian-8/
https://www.youtube.com/watch?v=t6faNpofYHI

Similar to above video I have the fallowing directories;

/root/Release/
/root/Release/php
/root/Sources

After reaching to 2:18 time level I get the fallowing error
Please see my steps after the error section here;

[root@SERVER ~]# systemctl restart httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
[root@SERVER ~]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2016-01-06 05:57:08 PST; 23s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 3773 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 3771 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 3771 (code=exited, status=1/FAILURE)

Jan 06 05:57:08 SERVER systemd[1]: Starting The Apache HTTP Server...
Jan 06 05:57:08 SERVER httpd[3771]: httpd: Syntax error on line 355 of /etc/httpd/conf/httpd.conf: Cannot load /usr/lib64/httpd/modules/libphp7.s... directory
Jan 06 05:57:08 SERVER systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jan 06 05:57:08 SERVER kill[3773]: kill: cannot find process ""
Jan 06 05:57:08 SERVER systemd[1]: httpd.service: control process exited, code=exited status=1
Jan 06 05:57:08 SERVER systemd[1]: Failed to start The Apache HTTP Server.
Jan 06 05:57:08 SERVER systemd[1]: Unit httpd.service entered failed state.
Jan 06 05:57:08 SERVER systemd[1]: httpd.service failed.
Hint: Some lines were ellipsized, use -l to show in full.


yum update && yum install httpd gcc libxml2-devel pkgconfig openssl-devel bzip2-devel libpng-devel libpng-devel libjpeg-devel libXpm-devel freetype-devel gmp-devel libmcrypt-devel mariadb-devel aspell-devel recode-devel httpd-devel

yum -y install epel-release
yum -y install php-mcrypt
yum install libmcrypt-devel
rpm -ivh http://dl.fedoraproject.org/pub/epel...6-8.noarch.rpm
rpm -ivh http://pkgs.repoforge.org/rpmforge-r....rf.x86_64.rpm




https://www.rpmfind.net/linux/RPM/ma...a6.x86_64.html
I tried to rpm -ivh this

[root@SERVER ~]# rpm -ivh ftp://195.220.108.108/linux/mageia/d...ga6.x86_64.rpm
Retrieving ftp://195.220.108.108/linux/mageia/d...ga6.x86_64.rpm
warning: /var/tmp/rpm-tmp.9Hutaw: Header V3 RSA/SHA1 Signature, key ID 80420f66: NOKEY
error: Failed dependencies:
lib64php_common7 >= 3:7.0.2 is needed by php-mcrypt-3:7.0.2-2.mga6.x86_64
[root@SERVER ~]#


Then i tried this
https://www.rpmfind.net/linux/rpm2ht...b64php_common7
rpm -ivh ftp://195.220.108.108/linux/mageia/d...ga6.x86_64.rpm

and it worked

[root@SERVER ~]# rpm -ivh ftp://195.220.108.108/linux/mageia/d...ga6.x86_64.rpm
Retrieving ftp://195.220.108.108/linux/mageia/d...ga6.x86_64.rpm
warning: /var/tmp/rpm-tmp.NzTGP9: Header V3 RSA/SHA1 Signature, key ID 80420f66: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1hp-mcrypt-3:7.0.2-2.mga6 ################################# [100%]
[root@SERVER ~]#






mkdir Release
mkdir Sources
cd Sources/

wget https://github.com/php/php-src/archi....0.2RC1.tar.gz
tar -xvzf php-7.0.2RC1.tar.gz -C /opt
cd /opt/php-src-php-7.0.2RC1

Here you can go either way;
./buildconf --force if you want to force it through php-7.0.2RC1.tar.gz
or
./configure if you configure from /opt/php-src-php-7.0.2RC1

I choose this;

./configure \
--prefix=$HOME/php7/usr \
--with-config-file-path=$HOME/php7/usr/etc \
--enable-mbstring \
--enable-zip \
--enable-bcmath \
--enable-pcntl \
--enable-ftp \
--enable-exif \
--enable-calendar \
--enable-so \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-curl \
--with-mcrypt \
--with-iconv \
--with-gmp \
--with-pspell \
--with-gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-xpm-dir=/usr \
--with-freetype-dir=/usr \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-openssl \
--with-pdo-mysql=/usr \
--with-gettext=/usr \
--with-zlib=/usr \
--with-bz2=/usr \
--with-recode=/usr \
--with-mysqli=/usr/bin/mysql_config \
--with-apxs2



ls -l /opt/php-src-php-7.0.2RC1 | grep php.ini
http://www.tecmint.com/wp-content/up...p.ini-File.png

cp /opt/php-src-php-7.0.2RC1/php.ini-development /usr/local/lib
cp /opt/php-src-php-7.0.2RC1/php.ini-production /usr/local/lib
depending on your choice of development or production
(production use not recommended for 7.0.2RC1)



gedit /etc/httpd/conf/httpd.conf

Below Include conf.modules.d/*.conf on httpd.conf
I added
LoadModule php7_module /usr/lib64/httpd/modules/libphp7.so
Was this correct or shall i edit conf.modules.d/*.conf and put it there?
I need your help to guide me through my steps and their order of proceeding each other.

At the end of httpd.conf I added
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>

Save and exit gedit

Terminal
systemctl restart httpd

If starting up Apache in CentOS 7 returns an error message saying it can’t find the libphp7.so module, simply copy to the indicated path from /opt/php-src-php-7.0.2RC1/.libs/libphp7.so.

Terminal
libtool --finish /opt/php-src-php-7.0.2RC1/libs

Terminal
cp /opt/php-src-php-7.0.2RC1/.libs/libphp7.so /etc/httpd/modules

is copying libphp7.la also necessary?

I need to CHMODE libphp7.so to 755
According to
https://www.maketecheasier.com/file-...mod-777-means/
Read is equivalent to ‘4’.
Write is equivalent to ‘2’.
Execute is equivalent to ‘1’
But In libphp7.so file Properties it has Read Only and Read and Write and None
Owner: root
Group: root (what should it change to from root?)
Other

I am stuck in make and make install section of this video on 2:20
https://www.youtube.com/watch?v=t6faNpofYHI

The rest is easy.
/etc /usr /var are compiled php 7.0.2 and all i need to di is to copy them to my system, ready to use.

Please tell me what i am doing wrong, or perhaps not in order because I keep getting this error while doing;

make install INSTALL_ROOT=/root/Release/php

This error keeps showing;

[root@SERVER php-src-php-7.0.2RC1]# make install INSTALL_ROOT=/root/Release/php
Installing PHP SAPI module: apache2handler
/usr/lib64/httpd/build/instdso.sh SH_LIBTOOL='/usr/lib64/apr-1/build/libtool' libphp7.la /root/Release/php/usr/lib64/httpd/modules
/usr/lib64/apr-1/build/libtool --mode=install install libphp7.la /root/Release/php/usr/lib64/httpd/modules/
libtool: install: install .libs/libphp7.so /root/Release/php/usr/lib64/httpd/modules/libphp7.so
libtool: install: install .libs/libphp7.lai /root/Release/php/usr/lib64/httpd/modules/libphp7.la
libtool: install: warning: remember to run `libtool --finish /opt/php-src-php-7.0.2RC1/libs'
chmod 755 /root/Release/php/usr/lib64/httpd/modules/libphp7.so
apxs:Error: Config file /root/Release/php/etc/httpd/conf/httpd.conf not found.
make: *** [install-sapi] Error 1


Thank you everybody...
 
Old 01-07-2016, 06:52 AM   #2
fmattheus
Member
 
Registered: Nov 2015
Posts: 104

Rep: Reputation: 38
Why not install from repository like this ... https://webtatic.com/packages/php70/ instead of compiling from source?
 
Old 01-07-2016, 08:33 AM   #3
Tadeh
LQ Newbie
 
Registered: Jan 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
7.0.1 had some bug fixes and improvements after 7.0.0
7.0.2 had more bug fixes and improvements after 7.0.1

http://php.net/archive/2015.php#id2016-01-07-1
It was released by php

source code of not released yet versions are at git hub
https://github.com/php/php-src/releases

Today 7.0.2 is released anyways...
http://www.php.net/downloads.php
http://php.net/archive/2015.php#id2016-01-07-1

I wanted to offer Linux world something new ahead of php.net
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can i get php repository in centos 5.5 jsaravana87 Linux - Server 1 08-16-2011 03:40 AM
LXer: Linux Users Still Left Out, Why Source Code Matters to End Users LXer Syndicated Linux News 0 10-15-2009 10:51 PM
Installing php source and rpm sucram2g Linux - Software 1 02-17-2007 03:22 AM
Does anyone know of a web based private source code repository HGeneAnthony Linux - Software 3 04-12-2006 02:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration