how to install php offline it have error please help me

General support questions
Post Reply
litawan
Posts: 1
Joined: 2021/11/23 17:16:34

how to install php offline it have error please help me

Post by litawan » 2021/11/23 17:27:29

root@localhost Packages]# rpm -ivh php*.rpm
warning: php-5.4.16-21.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
error: Failed dependencies:
libzip.so.2()(64bit) is needed by php-common-5.4.16-21.el7.x86_64
libt1.so.5()(64bit) is needed by php-gd-5.4.16-21.el7.x86_64
libodbc.so.2()(64bit) is needed by php-odbc-5.4.16-21.el7.x86_64
librecode.so.0()(64bit) is needed by php-recode-5.4.16-21.el7.x86_64
[root@localhost Packages]# rpm -e php-common-5.4.16-21.el7.x86_64
error: package php-common-5.4.16-21.el7.x86_64 is not installed
[root@localhost Packages]# rpm -e php-common-5.4.16-21.el7.x86_64.rpm
error: package php-common-5.4.16-21.el7.x86_64.rpm is not installed
[root@localhost Packages]# systemctl restart httpd
[root@localhost Packages]# php -v
bash: php: command not found...
[root@localhost Packages]#

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: how to install php offline it have error please help me

Post by TrevorH » 2021/11/23 17:34:26

The install failed due to missing dependencies so nothing got installed. So, for example, for:
libzip.so.2()(64bit) is needed by php-common-5.4.16-21.el7.x86_64
You would need to run yum provides 'libzip.so.2()(64bit)' to discover what package supplies that dependency then download that and put in your directory full of php packages and install it at the same time as the rest. Repeat that yum provides command for each of the missing deps listed, download each in turn and include them all in your install command. Repeat that for any new missing deps that those have.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

BShT
Posts: 583
Joined: 2019/10/09 12:31:40

Re: how to install php offline it have error please help me

Post by BShT » 2021/11/23 17:36:16

download deps somewhere else with internet access

# yum install --downloadonly --downloaddir=<directory> <package>

then copy to a pendrive and install

tunk
Posts: 1204
Joined: 2017/02/22 15:08:17

Re: how to install php offline it have error please help me

Post by tunk » 2021/11/23 18:04:19

php-5.4.16-21 is from 2014 and CentOS 7.0.
Either you're running C7.0 (which may be OK for an offline
server), or you should look for a newer version (which I think
BShT's advice will give you anyway).

Out of curiosity, why do you run httpd on an offline server?

User avatar
TrevorH
Site Admin
Posts: 33191
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: how to install php offline it have error please help me

Post by TrevorH » 2021/11/23 18:08:23

Yes, tunk is correct, that is a very old and insecure version of php. You should be attempting to install the latest CentOS 7 copy which is php-5.4.16-48.el7.

You might want to look at setting up a local CentOS mirror if you have many hosts and enough of them are disconnected from the internet to make it worthwhile. For information on how to go about setting up a local CentOS mirror please see https://wiki.centos.org/HowTos/CreateLocalMirror
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply