How to run php programs on local computer?

Matt Graham danceswithcrows at usa.net
Wed Jul 3 17:55:08 MST 2013


From: joe
> I did install apache2 and AFAIK php was installed with it.
> How can I check to confirm that?

Run your distro's equivalent of "rpm -qa | grep php"?  That only works for
Redhat-derived things, and won't work for Mint.  

> installed apache2 from Synaptic and it shows
> two additional components: libapache2-mod-php5 and
> libapache2-mod-php5filter as separate packages.

You probably want libapache2-mod-php5.  On Gentoo and CentOS, at least,
installing the php5 packages puts a libphp5.so file in the apache modules dir
(/usr/lib/apache2/modules/ on Gentoo, /etc/httpd/modules/ on CentOS), and adds
an additional config file for PHP to /etc/httpd/conf.d/ on CentOS.  The
default apache config file for CentOS includes all the things in conf.d/ .

There are several lines that need to be in apache's config for apache to load
the PHP module and associate .php files with that module.  Either those lines
aren't there, or they are there and you haven't restarted apache.  I don't
know whether Mint puts an additional config file in the way CentOS does or
makes you configure it manually like Gentoo, since I don't use Mint.  If you
like, find your apache config directory, tar it up, and put it somewhere, and
some of us could look at it.

> Is it possible to run php without apache?

Of course.  It's the php-cli package on CentOS, which has the additional stuff
you need for running PHP scripts on the command line.  

-- 
Matt G / Dances With Crows
The Crow202 Blog:  http://crow202.org/wordpress/
There is no Darkness in Eternity/But only Light too dim for us to see



More information about the PLUG-discuss mailing list