I am not sure if this is Unix related, but I can't really see what it would be, if it wasn't Unix related. I'm running a Ubuntu Server, and I'm trying to execute a .php script on my website when someone presses a button. Although, when it gets to triggering the script, it just shows the script code, and does not actually run it. Do I need to install something in order to make this work? I can confirm that this works on an actual webspace. I appreciate any help I can get!
|
In order for Apache2 to handle php requests, you need to install php. Since you are using Ubuntu, you can install by issuing these commands:
...and:
You then need to enable the apache module with:
You can of course install later versions of php if you desire, and if they are avialable for your Ubuntu version. When you are done with the above, restart apache with:
When you have done all of the above, try if your web server handles php correctly by putting something really basic* in the root directory of your web server like:
Assuming the script above is in a file called Hello!This is printed from a php script *I am generally not in favour of putting |
|||||||||||||||||||||
|