We have a legacy app running under PHP 5.3.3. (Don't ask.)

I have some 3rd-party code that needs 5.5+. It only needs to run via the command line, so I think it might be possible to simply(?) install 5.5 as a separate executable I can call when needed.

It would be running on Centos servers.

Anyone have any suggestions on the best way to do this, ensuring that the default "php" remains the current 5.3.3 install? (I am not a yum super-user. 😉 )

    yeah I just compile manually. Make sure to specify the install location so as not to overwrite the install you already have.

      Sorry, I was in a meeting and responded too early. I meant to also include that you might want to specify a separate config-file directory.

      ./configure [OPTIONS] --prefix=/usr/local/lib/php55 --with-config-file-scan-dir=/usr/local/lib/php55
      

      FYI, I rarely ever use package managers to install php - so if you run into any issues with compiling post back. I will be happy to help. 🙂

        Think I'll practice on my Mac first. 🙂

          OMG. I'm supposed to figure out which of these hundreds of options to use/disable/set? :eek:

          options.txt

            Yeah sure if that's how you want to think about it. I've never actually looked at the whole list of available options before. Just figured out what modules I needed (php -m will list the modules installed) and then build my configure command for that. Its generally --with-module to include a module, but a couple things are enable (why? I'm not sure). If it helps this is currently what I'm using for all my different apps:

            ./configure --enable-fileinfo --enable-bcmath --enable-libxml --enable-mbstring --enable-pdo --with-curl --with-gd \
               --with-gettext --with-mysqli --with-mysql-sock --with-pcre-regex --with-bz2 --with-pdo-mysql --with-openssl \
               --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-scan-dir=/usr/local/lib/php

            Note: you can get a current configure command from your install by doing 'php -i|grep configure' however most package managers don't build with many extensions built in, instead you add them as separate packages and they are loaded as shared libraries based on ini settings.

              I keep getting this error:

              checking whether to enable LIBXML support... yes
              checking libxml2 install dir... no
              checking for xml2-config path...
              configure: error: xml2-config not found. Please check your libxml2 installation.

              I trimmed the config down to this, but still get that error:

              ./configure --prefix=/usr/local/php55 \
              --with-config-file-path=/etc/php55 \
              --with-config-file-scan-dir=/etc/php55/php.d \
              --with-libdir=lib64 \
              --enable-mbstring \
              --disable-debug \
              --disable-rpath \
              --with-bz2 \
              --with-curl \
              --with-gettext \
              --with-iconv \
              --with-openssl \
              --with-gd \
              --with-mcrypt \
              --with-pcre-regex \
              --enable-pdo=shared \
              --with-pdo-pgsql=shared,/usr \
              --enable-json=shared \
              --with-zlib

                You need to have devel packages installed so the compiler can read the .h files. If you look at the script I sent you, it has a yum install at the top with a bunch of lib-devel libraries. The error tells me you probably need to:

                yum install libxml2-devel
                

                Of course, this will likely lead to a similar not found error for a lib that needs the devel package installed. 🙂

                Edit: Looking at your config command, you probably need all the following packages at a minimum (and probably a few more dependencies of dependencies)

                yum install libxml2-devel pcre-devel openssl-devel libcurl-devel gd-devel bzip2-devel
                

                  As of COB Friday, I had ended up Dockerizing it. The default official PHP 7 pull took care of most of what I needed, just having to add Postgres to the Dockerfile -- which required an apt-get to load the postgres-devel stuff, much the same as you suggested above for compiling it manually. Looks like it worked -- at least where it failed was after the point where it would have read from the DB, and the failure had nothing to do with the PHP config. 🙂

                  Anyway, just wanted to thank you again for the help, and I'm going to mark this resolved, even if it was more like "worked-around".

                  And in about 5 hours, I start my trek that will end up in the Dominican Republic for a week of sun, relaxation, and no programming. 🙂

                    NogDog;11056135 wrote:

                    As of COB Friday, I had ended up Dockerizing it. The default official PHP 7 pull took care of most of what I needed, just having to add Postgres to the Dockerfile -- which required an apt-get to load the postgres-devel stuff, much the same as you suggested above for compiling it manually. Looks like it worked -- at least where it failed was after the point where it would have read from the DB, and the failure had nothing to do with the PHP config. 🙂

                    Anyway, just wanted to thank you again for the help, and I'm going to mark this resolved, even if it was more like "worked-around".

                    And in about 5 hours, I start my trek that will end up in the Dominican Republic for a week of sun, relaxation, and no programming. 🙂

                    Have fun ... and if you're driving through Mexico, be very careful.....

                      I was flipping through the photos that went with that story and didn't notice at first that one was an ad for the Toyota Hilux.

                        Fortunately, there's a non-stop flight from Newark, NJ, to Punta Cana, D.R., which got me here without ever getting anywhere close to Mexico. (The Dominican Republic shares an island with Haiti, east of Cuba. Driving through Mexico in any direction would never get you here, unless your car was amphibious, and able to cover hundreds of miles across the wet stuff. 😉 )

                          Heheh, not sure what I was thinking. Guatemala, perhaps?

                          I coulda swore you said Belize or something. That was obviously on a different forum ... I see some photos from a friend on FB right now AAMOF.

                          Punta Cana looks like fun. Enjoy!

                            Write a Reply...