PHP

I’m trying to get PHP working on my local server and have had no luck I have the latest version installed
but it won’t display the PHP file on my site? Running XP Pro and IIS
Thanks Steve

Steve,

As a PHP/IIS user I can tell you the two don’t like each other. I’ve been mostly successful with the process but some scripts still won’t work, I think because of IIS. If you can run this script which hopefully will show that you can in fact run PHP…

<html>
<head>
<title>PHP test</title>
</head>
<body>
<h1>Does PHP work?</h1>

<?php echo "<h2>Yes, it does. PHP Version " . phpversion() ."</h2>"; 
echo "<p>To run the WXSTICKER script, you need GD enabled in PHP.\n";
echo "
Current GD status:</p>\n";
echo describeGDdyn();

// Retrieve information about the currently installed GD library
// script by phpnet at furp dot com (08-Dec-2004 06:59)
// from the PHP usernotes about gd_info
function describeGDdyn() {
echo "\n<ul><li>GD support: ";
if(function_exists("gd_info")){
echo "<font color=\"#00ff00\">yes</font>";
$info = gd_info();
$keys = array_keys($info);
for($i=0; $i<count($keys); $i++) {
if(is_bool($info[$keys[$i]])) echo "</li>\n<li>" . $keys[$i] .": " . yesNo($info[$keys[$i]]);
else echo "</li>\n<li>" . $keys[$i] .": " . $info[$keys[$i]];
}
} else { echo "<font color=\"#ff0000\">NO</font>"; }
echo "</li></ul>";
}
function yesNo($bool){
if($bool) return "<font color=\"#00ff00\"> yes</font>";
else return "<font color=\"#ff0000\"> no</font>";
}


?>

<p>If you don't see "Yes, it does." above, then PHP is not enabled.</p>
</body>
</html> 

You may need to modify your php.ini file, hopefully you have access to it. For instance I just learned this week that “short arrays” needed to be on for some scripts to work. This site http://saratoga-weather.org/scripts.php and “Ken” are also extremely helpful with all of this too. If I can help with anything let me know but I am still a novice at best, lots of people have helped me and I’m glad to return the favor if I can!

Jack

That is the script I have been trying and it won’t work My server is here locally so I believe it is something in my setup? I have made some changes to th php.ini
but still nothing!

All of my direct experiences with PHP have been on the Apache (on Linux/Unix) platform, so I’m sorry I don’t have any advice for you on fixing the issue.

Have you gone to http://us2.php.net/manual/en/install.windows.iis.php and followed the install instructions and validation testing? That might get the basic PHP issue fixed. You didn’t say whether you were using PHP 4 or PHP 5 (and there are some differences, as Jack had found out too :slight_smile:

I’d recommend a remove and reinstall (assuming this is your own server) of PHP from www.php.net fresh build, then after the validation test works, trying the script Jack cited. You’ll definitely want GD with your PHP to allow nifty things like Anole’s wxsticker script to work.

Best regards,
Ken

Sorry useing PHP 5 and I am in the process of reading that now HAHA Thanks!!

Ok,

Try this setting first…

; Enable compatibility mode with Zend Engine 1 (PHP 4.x)
zend.ze1_compatibility_mode = Off

Can’t find this setting?

:smiley: :smiley: :smiley: AHA it was becuase I used the default install to C:\Program Files\PHP No good reinstalled it to C:\PHP and now it works!!! #-o

Excellent!

The snipet I put in before was from the php.ini file, just in case you have to make any other adjustments. Prepare to stay up late making your new pages now :smiley:

Jack

HA thanks for the help It seems to run most of the templates I tried so far no problem now!

That’s great! Now you should have the capability to run the PHP scripts to enhance the info presented on your website.

Best regards,
Ken

While testing I get this at the beggining
Warning: filemtime() [function.filemtime]: stat failed for forecast.txt in C:\Server\adv.php on line 65
and this line at the very end???
PHP Warning: PHP Startup: Unable to load dynamic library ‘C:/Program Files/PHP/ext/php_msql.dll’ - The specified module could not be found. in Unknown on line 0
any ideas?

Didn’t you write above that you moved it to c:\php ?

Yup I did thats what I can’t figure out!!

Must be a config setting if the program files path isn’t in the code.

Been looking for a bit haven’t found it yet!

Are you stuck running IIS ?

I know many that have issues with IIS for more than just PHP. Apache is a much easier server and better supported.

You might give Xampp a try:

http://www.apachefriends.org/en/xampp-windows.html

Thanks I will have a look and see what it’s all about!