Help!

First thank you to anyone that can help!

I have been hosting a website with a company for a while but have decided to try and move it to one of my own computers. But I cannot get my php to show correctly.

A simple example of what works on my current web host but does not work on my home computer:

Data.php

<?php $config['site_name'] = "MySite"; ?>

1.php

<?php include "data.php"; print $config['site_name']; ?> <?=$config["site_name"]?> <? print $config['site_name'];?>

This code only displays ‘Mysite’ from the first “print” and does nothing for the next two.

Can anyone help? What is my problem?

Thanks

<?php include "data.php"; print $config['site_name']; ?> <?=$config["site_name"]?> <? print $config['site_name'];?>

You are missing a ; after the <?=$config[“site_name”]

Try this:

<?php include "data.php"; print $config['site_name']; ?> <?= $config["site_name"]; ?> <? print $config['site_name']; ?>

still doesnt work, it seems to not want to do anything after i close the first set of <? ?>

do you have error reporting turned on? if so check the logs and see what you are getting.

I looked at the logs… nothing looks wrong, but im not sure what i exactly looking at… . this is the log since i started it up…

[Wed Nov 10 18:27:48 2010] [notice] Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1 configured – resuming normal operations
[Wed Nov 10 18:27:48 2010] [notice] Server built: Nov 11 2009 14:29:03
[Wed Nov 10 18:27:48 2010] [notice] Parent: Created child process 58628
[Wed Nov 10 18:27:50 2010] [notice] Digest: generating secret for digest authentication …
[Wed Nov 10 18:27:50 2010] [notice] Digest: done
[Wed Nov 10 18:27:51 2010] [notice] Child 58628: Child process is running
[Wed Nov 10 18:27:51 2010] [notice] Child 58628: Acquired the start mutex.
[Wed Nov 10 18:27:51 2010] [notice] Child 58628: Starting 150 worker threads.
[Wed Nov 10 18:27:51 2010] [notice] Child 58628: Starting thread to listen on port 443.
[Wed Nov 10 18:27:51 2010] [notice] Child 58628: Starting thread to listen on port 8000.

Does anything look wrong?

Thank you for helping!

For anyone else with this problem, Heres the solution!!!

http://www.thesitewizard.com/php/install-php-5-apache-windows.shtml

Did you not have Short Tags enabled?

That will do it :wink:

I thought you had been using short tags for the top part as well.

Sponsor our Newsletter | Privacy Policy | Terms of Service