I’m not new to Linux, but I am new to php. I’m trying to set up a lamp server. Using Debian 7.2, Apache2, Mysql, and PHP.
I want to install wordpress eventually.
Doing all this in a VM using virtualbox (4.2.10).
Now, have installed the OS. Using apt-get installed apache, mysql, and php.
Apache is installed. the test page displays.
Mysql I can log into the mysql cli.
The php test page does not display. The browser (firefox) says it can’t find the file. This test uses the code as follows:
it was placed in /var/www (the same place the test index.html file is.
Further, when I type php -a to invoke the interactive php shell, it seems to halfway work. It acts as if I was in a cli shell, except it doesn’t display any kind of a prompt. Further, I can type stuff into this, but it does nothing except move to the next line (after pressing the enter key, as if it was text editor) or nothing. For example, type “echo 5+8;” produces nothing.
Looking up documentation on installing these components in debian, the docs say I should have a file libphp5.so in a modules diirectory somewhere. Using find I cannot fine a file libphp5.so nor a directory module or modules.
So, a little help here. Anyone have a clue why this is not happening?
Then as far as Apache is concerned, inside /etc/apache2/mods-enabled you should see php5.conf and php5.load
php5.load will have LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
php5.conf will have the rules for which files get sent to the php parser.
The modules directory is /etc/apache2/mods-available.
In the terminal you can enable the php5 module using the command: sudo a2enmod php5
Though I believe that module should already be enabled. You can check in the directory /etc/apache2/mods-enabled to see if there is a php5.conf and php5.load file. If there is than the php5 module is already enabled. If not you can run the previous command to enable the php5 module.