0

I created a php script:

#!/usr/local/bin/php

<html><head><title>PHP Test</title></head>
<body>
<?php print( "Hello World<br />"); ?>
</body></html>

created an htacces file

AddHandler cgi-script .php
DirectoryIndex index.html index.php

changed the permission

chmod 711 hello.php
chmod 644 htaccess

This does not work:

http://xyz/~username/hello.php

By making the hello.php to hello.txt the file content can be viewed on the browser. I am not sure what can be done about it?

Thanks

3
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by itanum
0

If you are trying to run this on your own (local) machine, then you need to create a LAMP (Linux Apache MySQL PHP) environment. There are free packages like EasyPHP and WAMP that you can download to do this. You need to have a simulated Linux server environment (or a Windows server if that is your preference). PHP is a server-based language. PHP isn't actually executed by your Browser (unlike HTML or javascript).

0

Unfortunately I am hosting this on a university department server where they gave me that much information only. So I am bound by this limited opportunity.

0

did you upload a php-file with code:

<?
phpinfo();
?>

So you can see the module's, running at your server and what scripts is allowed to execute.

Edited by itanum: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.