whats wrong with php on my pc

Have you enable PHP in the Apache config file?

Try making a php page with the following code and running it

Code:
<?php

// Show all information, defaults to INFO_ALL
phpinfo();


?>
 
[edit]

just found out and worked out the problem, i needed to put _2 at the end of my code as im using apache 2.2 and not 2.0

anyways im still having a problem. im trying to get the php file to connect to mysql database and then echo out connection made, but when looking at the file on ff it just shows a blank white page.

code for temp_con.php
Code:
<?php
	require ($_SERVER["DOCUMENT_ROOT"]."/config/db_config.php");
	$connection = mysql_connect ($db_host, $db_user, $db_password); or die("error connecting");
	echo "connection made";
?>

code for db_config.php
Code:
<?php

	$db_host = "localhost";
	$db_user = "adam";
	$db_password = "something is here but have removed it for the forum";
	$db_name = "db_01";
	
?>

anything wrong with that script? I have tried another which is a counter script and it's doing the same thing, just showing a white page. Surely if the connectino couln'dt be made it would echo out error connection?

Also out of curiousity, im doing all this for a website that is going to need counter, user logins. what im wondering is how do i get the settings i have set up on my pc on the server that will host my site? will i have to just redo another one?
 
Last edited:
Turn error reporting on or up to E_ALL or E_ALL^E_NOTICE - http://uk.php.net/error_reporting - to discover what errors are occuring.

The problem likely lies in a syntax error on line 2:
Code:
$connection = mysql_connect ($db_host, $db_user, $db_password)[COLOR=Yellow]; or die("error connecting");[/COLOR]
Remove the semicolon before the OR:
Code:
$connection = mysql_connect ($db_host, $db_user, $db_password) or die("error connecting");
 
Back
Top Bottom