简体   繁体   中英

PHP: browser just downloads the file instead of reproducing it

I'm using Linux Mint, Apache2 and PHP5. My Web IDE is Aptana Studio 3.

When I try to run my PHP file, the browser, instead of reproducing the content of the PHP

 <?php echo "hello" ?>

it just downloads the file, not even showing it's content on the screen.

I'm new to PHP so I would like to have a hand here. Why is this happening and how should I solve it? Thank you for your time

It sounds like you haven't got the PHP extension enabled in Apache or the module loaded.

Have a look in /etc/apache2/mods-enabled and check for a symlink to ../mods-available/php.load (or something similar)

That's usually all you need to do on apache2 to enable the module.

<?php echo "hello" ?>

should be replaced by:

<?php echo "hello"; ?>

But this won't solve your question. Your php file will be downloaded by the browser as apache is not working in the right way. As we can't see how you did set it up we won't be able to solve your question.. Can you provide us with some more information? PHP extension not installed?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM