I have a lot of cron jobs that I built with php that I need a commandline php installed for. However, I would like the speed of the apache module version installed for web use.

Is there any way I can do both? Right now I have php compiled with apxs. I guess I'll have to recompile it without that If I want the commandline version to work. I just wish I could do both.

CAN I do both? Anyone? maybe in the upcoming 4.1 release with versioning?

  • Shaz

    Doug,

    Building a binary copy of PHP shouldn't affect the way that your libphp4.so functions. It just means you get two different versions of the interpreter which you end up using for different purposes.

    geoff

      The INSTALL file says this at the top:

      "Note! Only install either the static module or the dynamic one. Do not install both."

      Does static = cgi/cmd line and dynamic = apache? I'm confused by that. What is dynamic and static?

      • Doug

        No, static = static linked into Apache, Dynamic is DSO. The commandline is completely different.

        • Keith

          Doug,

          To elaborate on Keith's post, both static and dynamic refer to running PHP as an Apache module. The difference is with a static installation, PHP linked directly into Apache and requires you to recompile Apache everytime you recompile, upgrade, or add extensions to PHP. A dynamic installation let's you recompile the PHP DSO at will without needing to recompile Apache as the DSO is loaded into the server via httpd.conf. The --with-apxs config option indicates that you are using the DSO.

          For command line, you need to compile a PHP CGI binary executable. To do this, issue make clean and rebuild PHP without the --with-apache and --with-apxs options.

          geoff

            I'll add that if your apache DSO module built fine, and you like the way it works, you can just do a ./configure without the apxs switch and a make and it SHOULD work fine. I've tried both ways, and it seems to be OK to do it this way.

            Note that a lot of problems crop up with configuring php for different modules without a make clean in between those, but for changine from DSO to command line, it's usually not necessary.

              Write a Reply...