Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NEWBIE: stand-alone 1

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
can I run php/mySQL on a machine as a stand-alone? if so, where do I download the software to do such

[conehead]
 
sure you can.

all you need is PHP and Mysql configured and installed

You're going to be setting up your scripts like you would a bash script.

a simple example of a stand alone PHP script

#!/usr/bin/php
<?
// Date formatting
// Month Types: M = May m = 05
// Day Types: D = Tue d = 02
// Year Types: Y = 2004 y = 04

function formatDate($val)
{
$date = date("M-Y"); // Put layout requirements here
return $date;
}
$date = formatDate('timestamp');
echo "$date \n";
?>

copy the above into a file making sure that
#!/usr/bin/php // is on line 1

chmod 777 the file
then type the file name and you should get Nov-2004

It runs the same as it would in apache with a few differences.
 
Any guidance as to what I need to download if I simply want it to work on my machine?

[conehead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top