I just setup a new server which will host a solr daemon. As it stands now the solr index is empty, but I have a php script available to pull data from a MySQL store and populate the solr index to facilitate my fulltext searching requirements.
So I'm wondering, is it possible to compile PHP to be command line only? It seems a waste to have to install apache just to get PHP to work.
— Edit —
A little more clarification. When I run make install
on CentOS, the make attempts to add PHP footprint to /etc/httpd/conf. Is it ok to simply ignore this? Or is there a flag I can pass to ignore apache?
Best Answer
If you must compile on Red Hat, CentOS or other Red Hat-derivatives, I recommend you use rpmbuild -bb (I'll explain in the moment) with the .spec.in provided in the php source either by Red Hat or by upstream developer (PHP). Here is a sample from the upstream:
See where it says "--with-apxs"? That is part of development interfaces for the Apache HTTP server. If that is not installed, you will get when running configure (and I believe that is what you are seeing):
To compile without apxs support (and thus avoiding the need for apache), you would change that to:
And it will get that pass that point.
Now back to building with a spec file. if you build it with a spec file, rpmbuild will tell you what dependencies you need that will allow you to install. And from there, it will build a package for you and you can install it with:
yum localinstall php.rpm
Which will then allow you to install as well as satisfy the other requirements. That will save you lot of grief by managing your system properly with a packaging system rather than trying to build and install manually.
(or you can follow embobo's advice and install just php-cli ;) ).