How to run php programs on local computer?

keith smith klsmith2020 at yahoo.com
Wed Jul 3 17:06:49 MST 2013



I think you may need to do chkconfig mysqld on as well do MySql auto starts on boot.

------------------------

Keith Smith

--- On Wed, 7/3/13, Matt Graham <danceswithcrows at usa.net> wrote:

From: Matt Graham <danceswithcrows at usa.net>
Subject: Re: How to run php programs on local computer?
To: "Main PLUG discussion list" <plug-discuss at lists.phxlinux.org>
Date: Wednesday, July 3, 2013, 12:18 PM

> From: kitepilot
>> Install Apache in your box and run from http://localhost/ 
>> If they are 'shell', make sure that the first line is:
>> #!/bin/php (whatever 'which php' resolves to...)
From: keith smith 
> If you are doing any data stuff, you will have to pull in MySql as
> well.

The exact steps to take to get apache+PHP running vary depending on which
distro you're using.  On CentOS/RHEL, you'd do:

yum install httpd php53 php53-mysql
/etc/init.d/httpd start
# optional, but makes it so apache always starts on boot
chkconfig httpd on

...once these things are done, you can put PHP code within .php files in some
dir under /var/www/localhost/ .  Then going to http://localhost/myfile.php in
a browser should execute that PHP code and display the results in that
browser.

The process is conceptually similar on all distros, but the details will be
different.  The first thing I'd do is search the Net for "$DISTRO apache php
setup" since many people have had the same wants/needs.  There are (usually)
default configurations in the distro packages that make running a simple setup
easy.  apache configs can get large and complex if you're doing complicated
things (like hundreds of RewriteRules and hundreds of different vhosts) but
you probably don't need those things just yet.

-- 
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

---------------------------------------------------
PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phxlinux.org/pipermail/plug-discuss/attachments/20130703/48024a65/attachment.html>


More information about the PLUG-discuss mailing list