Jump to content

PHP Won't Work


Recommended Posts

After ages of messing around trying to sort out the path variable, I managed to get the PHP .MSI installer to work on my Apache 2.0.59 server. The PHP I refer to is 5.2.3.

 

It now loads PHP files perfectly well, but for some reason it cannot do any PHP operations. For instance:

 

Hello world!

 

This loads perfectly, despite having a PHP extension. The text 'Hello world!' appears in my browser.

 

<?PHP
$variable = Tom

echo "Oh, hello, $variable."
?>

 

This simply gives me a big white screen.

 

Any help?

Anybody know why this is happening?

Link to comment
Share on other sites

Ack, sorry for the double post. I read this topic: http://www.phpfreaks.com/forums/index.php/topic,146784.0.html

 

And that told me what I was doing wrong.

 

My new question is; is there any way I can make it work without using PERFECT syntax? Many codes are not done perfectly and thus they do not work on my server, whereas they did on my old server hosted by a professional company. How can I change this?

Link to comment
Share on other sites

My new question is; is there any way I can make it work without using PERFECT syntax? Many codes are not done perfectly and thus they do not work on my server, whereas they did on my old server hosted by a professional company. How can I change this?

 

Try lowering the error_reporting setting.

 

Check the status of register_globals as well ('professional' servers often set it to ON so crappy old scripts still run and they don't get support calls all the time).

Link to comment
Share on other sites

Well, seems like:

<?PHP

$variable = Tom

 

echo "Oh, hello, $variable."

?>

 

should have ;'s at the end of each line. i.e.

<?php

$variable = 'Tom';

echo "Oh, hello, $variable.";

?>

 

There could be some settings in php.ini which may elleviate having to use a semi-colon. If you can get the settings used on your old server, that'll help a lot.

 

-steve

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.