different version php on command line and in apache

前端 未结 2 931
孤街浪徒
孤街浪徒 2021-01-11 21:23

I am using mac 10.8 and I have installed php 5.5. At command line php -v show version 5.5. but when I starts mac\'s apache server with phpinfo(), it show version 5.4.

<
2条回答
  •  感情败类
    2021-01-11 21:56

    1. find out the conf/httpd.conf and conf.d/*.conf

    2. find the tag like this: LoadModule php5_module modules/libphp5.so

    3. make the change to correct php installation folder like this: LoadModule php5_module /usr/local/Cellar/php54/5.4.8/libexec/apache2/libphp5.so

    This will change your php model (php version) in Apache

    Search on your local desk: find / -name "libphp5.so"

    Regarding the correct so file: libphp5.so not being created after compiling and prefix directory not created

    [update]

    http://www.howtoforge.com/centos-5.6-php53-common-conflicts-with-php-common

    1) update yum to include latest php

    2) For 64bit systems, you can find the correct packages here: http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/

    For 32bit systems, the correct packages are here: http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/

    3) (replace to the correct URL and file name which you want to have, check it from step "2)")

    rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-5-4.noarch.rpm

    rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-11.ius.el5.noarch.rpm

    4) rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL

    rpm --import /etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY

    5) yum install yum-plugin-replace

    6) You can now replace your PHP old version packages with the PHP new version packages from IUS like this:

    yum replace php --replace-with php55w

    You can search for further php55w packages like this:

    yum search php53u

提交回复
热议问题