SOLVED Install php7-devel

bloom360

Active Member
Feb 23, 2015
25
4
3
cPanel Access Level
Root Administrator
I need to install a custom PHP extension. I am running PHP 7.1 on CentOS 7.5

I tried to compile but I got the following errors:

Code:
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate
I believe this means I need to install php7-devel, is this correct?

To try my luck, I did:

Code:
yum install php7-devel
but got:

Code:
No package php7-devel available.
Any help would be greatly appreciated
 

bloom360

Active Member
Feb 23, 2015
25
4
3
cPanel Access Level
Root Administrator
Hi @cPanelMichael

It's a rather niche extension, surely nothing that you would have heard of. But in any case, here it is... I first downloaded it from Github, then patched it and then tried to phpize and install:

Code:
[[email protected] sweph]# git clone https://github.com/Britskiy/php-sweph.git
Cloning into 'php-sweph'...
remote: Counting objects: 26, done.
remote: Total 26 (delta 0), reused 0 (delta 0), pack-reused 26
Unpacking objects: 100% (26/26), done.
[[email protected] sweph]# cd php-sweph
[[email protected] php-sweph]# patch -p1 < ../sweph-php7/sweph-php7.diff
patching file sweph.c
[[email protected] php-sweph]# /opt/cpanel/ea-php71/root/usr/bin/phpize && ./configure
... and got:

Code:
Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /opt/cpanel/ea-php71/root/usr
checking for PHP includes... -I/opt/cpanel/ea-php71/root/usr/include/php -I/opt/                                  cpanel/ea-php71/root/usr/include/php/main -I/opt/cpanel/ea-php71/root/usr/includ                                  e/php/TSRM -I/opt/cpanel/ea-php71/root/usr/include/php/Zend -I/opt/cpanel/ea-php                                  71/root/usr/include/php/ext -I/opt/cpanel/ea-php71/root/usr/include/php/ext/date                                  /lib
checking for PHP extension directory... /opt/cpanel/ea-php71/root/usr/lib64/php/                                  modules
checking for PHP installed headers prefix... /opt/cpanel/ea-php71/root/usr/inclu                                  de/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate                                   PHP parsers.
checking for gawk... gawk
checking whether to enable sweph support... yes, shared
checking for sweph files in default path... not found
configure: error: Please reinstall the sweph distribution
 

sktest123

Well-Known Member
Jan 31, 2017
99
6
8
kochin
cPanel Access Level
Root Administrator
the re2c is an independent package and could be installed with the steps at stackoverflow.com/questions/48220083/how-to-install-re2c-on-linux-centos-7
or blog.csdn.net/jacson_bai/article/details/43604281
WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers - CSDN博客 (just translate)
the "sweph files not found " needs to dealt with wrong path directory , review code.google.com/archive/p/php-sweph/issues/3
Google Code Archive - Long-term storage for Google Code Project Hosting
 

vaibhav shukla

Registered
Oct 27, 2018
4
1
3
Pune
cPanel Access Level
Root Administrator
I am trying to install the same extension php-sweph.Running php version 5.6 under centos 7.5 kvm.
As mentioned in the installation i wanted to follow these steps:
Code:
git clone github.com/cyjoelchen/php-sweph.git
   cd php-sweph
   phpize
   ./configure
   make
   sudo make install
I followed equivalent steps on centos7.5.Below is what i got.
Code:
[[email protected] ~]# git clone github.com/cyjoelchen/php-sweph.git
fatal: destination path 'php-sweph' already exists and is not an empty directory.
[[email protected] ~]# cd php-sweph
[[email protected] php-sweph]# /opt/cpanel/ea-php56/root/usr/bin/phpize && ./configure
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
configure: error: Cannot find php-config. Please use --with-php-config=PATH

Next steps are to run make files generated in the configuration and yum make install.But configuration command is not working and  make and install commands not working.

[[email protected] php-sweph]# make
make: *** No targets specified and no makefile found.  Stop.
Need some help regarding this problem.
Thank you.
 
Last edited by a moderator:

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,234
363
cPanel Access Level
DataCenter Provider
Twitter
# /opt/cpanel/ea-php56/root/usr/bin/phpize && ./configure
Hello @vaibhav shukla,

The installation of this PHP package is unsupported. However, as far as the above command itself goes, you'd want to use something like this instead:

Code:
/opt/cpanel/ea-php56/root/usr/bin/phpize && ./configure --with-php-config=/opt/cpanel/ea-php56/root/usr/bin/php-config
Thank you.
 

vaibhav shukla

Registered
Oct 27, 2018
4
1
3
Pune
cPanel Access Level
Root Administrator
I am facing php error due to incomplete installation of this package php-sweph.Don't know how to solve it.
The error is:
PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php56/root/usr/lib64/php/modules/sweph.so' - /opt/cpanel/ea-php56/root/usr/lib64/php/modules/sweph.so: cannot open shared object file: No such file or directory

First I need to solve this error and I no more require this php package.I want to remove it.

How to remove the error and the php package?
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,911
2,234
363
cPanel Access Level
DataCenter Provider
Twitter
PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php56/root/usr/lib64/php/modules/sweph.so' - /opt/cpanel/ea-php56/root/usr/lib64/php/modules/sweph.so: cannot open shared object file: No such file or directory

First I need to solve this error and I no more require this php package.I want to remove it.

How to remove the error and the php package?
Did you add an entry for it in the /opt/cpanel/ea-php56/root/etc/php.ini file? If so, remove the entry, save the file, and then restart Apache.

Thank you.
 

vaibhav shukla

Registered
Oct 27, 2018
4
1
3
Pune
cPanel Access Level
Root Administrator
I had added entry in php.ini file.I want to remove the entry.But I searched for the line extension=sweph.so in all php.ini,i am unable to find it.I came across six-seven php.ini files.I checked them all but didn't find either.I searched text 'extension=sweph.so' using grep command.I am not getting the text 'extension=sweph.so' in ant php.ini file.What can be done in this scenario?
Thank you.