Jump to content

Recommended Posts

Hello

 

I have Apache/PHP/MySQL installed. I am developing an application. Everything was going well, save my bugs. Then, for no apparent reason, PHP files stopped executing. When accessing the following script:

 

<?php

  phpinfo();

?>

 

I just get the exact same output to the browser. When I access a longer script, it outputs _PART_ of the source code, starting around 5 lines into the file (yeah, really).

 

I tried reinstalling Apache and PHP (deleting the config files for both) and it did absolutely nothing. I didn't have to modify the config files initially when everything worked fine.

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/126989-php-files-stopped-executing/
Share on other sites

There one two problems I can think of,

1. Apache is not configured correctly for handling .php files. How did you install Apache and PHP, and how is Apache configured?

 

2. Your scripts use short tags (<? ?>, or <?= ?>). PHP disables short tags by default when installed. You can enable short tags via the php.ini by enabling a setting called short_open_tag. If your script uses short tags and they are disabled then you can get irregular results like this. It is recommended that you do not use short tags.

I forgot to mention that this is on XP SP2 32-bit.

 

1. When I installed PHP with the installer, I browsed to the Apache conf directory. I then checked, and the conf was modified as I presume it should have been, since initially _it was working_ and the config file

was not modified. It then stopped working.

 

2. I don't use short tags.

Ho ho I am an idiot  :o

 

The problem was trivial. For some reason, I began accessing the PHP file I was working on through the full path - i.e. c:\dir\test.php instead of localhost:8080\test.php

 

No wonder Apache wasn't executing the script  ::)

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.