Jump to content

can't get php to start


Recommended Posts

Hey everyone,

after some googling, I landed on this website, I am hoping that you guys will not let me down.

I am fairly new to php, i installed phptriad, started apached, created a test file called test.php, put it in my c:\apache\htdocs\

then tried to run it in //localhost/test.php, and nothing comes up

for example, i put this in the file

<?php
$name = "sun";
$age = "14";
echo "Hi i am $name and i am $age years old";
?>

and this is what i get

<?php
$name = "sun";
$age = "14";
echo "Hi i am $name and i am $age years old";
?>

The only thing that i did is that i installed some FF updates, that's all

thanks

Link to comment
https://forums.phpfreaks.com/topic/31433-cant-get-php-to-start/
Share on other sites

apache isn't recognizing .php as a valid page and doesn't know what to do with it.

stop and restart apache

if that doesn't work, in your Apache config file, scroll to the very bottom and there should be a line in there that was placed by the php installation.  If that isn't there, reinstall php.
Link to comment
https://forums.phpfreaks.com/topic/31433-cant-get-php-to-start/#findComment-146007
Share on other sites

Thank you,
it's working now

I installed PHP coder, i wrote some code to get some info from mysql DB called Library, and table is called Books

<?php
// making the connnection
$query = "SELECT * Books";

$result = mysql_query($query) or die(mysql_error());


$row = mysql_fetch_array($result) or die(mysql_error());
echo $row['Book Name']. " - ". $row['Date'];
?>

I just wanna print the name of the book and the date (just for testing purposes).

But for some reason, I am unable to connect my php coder to my local server, what is my webserver doc diectory and what's my web server root url?

Link to comment
https://forums.phpfreaks.com/topic/31433-cant-get-php-to-start/#findComment-146125
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.