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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.