So I'm setting up a new workstation for myself that's purely Linux. I'm trying to get all our stuff working as configured without having to create containers just to run our app. I'm having a problem getting the correct ini file to load. What's confusing me, is when I look at the configure command, it shows the config path as being what I expect, but when I use php --ini it doesn't match the path in the configure command. (see below) Also of note is that the scan dir doesn't seem to be correct either. Any ideas why these wouldn't match, or more specifically what I need to do to make it correct?

08:02:32 {master} ~/repositories/repository$ php --ini
Configuration File (php.ini) Path: /usr/local/apache-php//lib
Loaded Configuration File: (none)
Scan for additional .ini files in: (none)
Additional .ini files parsed: (none)

08:02:52 {master} ~/repositories/repository$ php -i | grep configure
Configure Command => './configure' '--prefix=/usr/local' '--with-libdir=lib64' '--with-gd' '--with-curl' '--with-freetype-dir=/usr/include/freetype2' '--enable-wddx' '--enable-ftp' '--without-sqlite' '--without-pdo-sqlite' '--with-pdo-mysql=mysqlnd' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-jpeg-dir=/usr/lib64' '--with-png-dir=/usr/lib64' '--with-zlib-dir=/usr/lib64' '--enable-zip' '--with-config-file-path=/usr/local/apache-php/conf/''--with-config-file-scan-dir=/etc/php.d' '--enable-sockets' '--enable-pcntl' '--enable-soap' '--enable-mbstring' '--with-xsl' '--with-apxs2=/usr/local/apache-php/bin/apxs'

    I don't know if this was a copy-paste and/or COLOR formatting error, but there is a suspiciously missing space between the single quotes that surround those two options.

    EDIT: I don't even know if that would throw off the CLI argument parser; I just know that I can't find anything more egregiously incorrect. 🙂

      Ah well see, that's the output of a command, supposedly meaning that's the configure command that php thinks it is using (minus erroneous missing space when I moved the /color tag). But when I do the ini command, it shows a different state. I've used these flags before, so I'm not sure why it would be wrong now. For fun, I set up a phpinfo() page to access from apache, and it has the same configure command listed, with the same non-matching paths for ini files. I'll try wiping it and make again tomorrow, see if that does anything useful.

        6 days later

        Just to be clear, PHP is not using that configure command. You are in fact running a shell script when you enter that and the parameters you supply must be properly delimited if it is to work correctly.

        That configure command does NOT simply configure PHP to work differently. It makes changes to the source code in that directory with the PHP source so that when you run make and make install then your configuration values will be compiled into your installed php executable and its corresponding php.ini file. In other words, you cannot simply run that configure command and expect php to behave differently on your system because that command has no impact at all on the version of php that is actually installed on your system.

          I think you're mistaken there sneaky. The commands I showed here, are on the php executable itself. Meaning, that yes the configure command you see if what the executable believes it was configured, made and installed using. Also, the ini output is from the executable itself, this tells me the executable is confused about its own settings.

          No matter what, I was unable to get it working. I have reinstalled CentOS from the ground up, and recompiled everything with the same commands. Now its all working perfectly.

            5 days later
            Derokorian;11043659 wrote:

            I think you're mistaken there sneaky. The commands I showed here, are on the php executable itself. Meaning, that yes the configure command you see if what the executable believes it was configured, made and installed using. Also, the ini output is from the executable itself, this tells me the executable is confused about its own settings.

            I just meant to point out that running that one single command isn't going to change anything -- all it does is change the configuration of the source code. You have to compile and install the php executable for those changes to take effect in your system. I would have been curious how you were evoking PHP (apache? cli?). I think it would be important to verify that the source code you were configuring was in fact getting installed where you were trying to run it from.

            Derokorian;11043659 wrote:

            No matter what, I was unable to get it working. I have reinstalled CentOS from the ground up, and recompiled everything with the same commands. Now its all working perfectly.

            Glad to hear this. If you are using CentOS, you might want to take advantage of its package management system, yum, rather than compiling from source.

            yum search php
            yum install php
            
              sneakyimp;11043683 wrote:

              Glad to hear this. If you are using CentOS, you might want to take advantage of its package management system, yum, rather than compiling from source.

              yum search php
              yum install php
              

              Yeah, I don't like using package managers. Means I'm not configuring things myself the way I want em 🙂

                Yeah they tend to lag way behind. I think Ubuntu 12 is still on php 5.3.

                  Write a Reply...