There are lots of tutorials available for Apache,MySql and PHP installation on linux and Windows. But I prefer the simple one for Debian.Command will not work without caret(^).
sudo apt-get install lamp-server^
Now,This will download and install the Apache,PHP and MySql.
step1 : test "localhost" in browser. Works !!step2 : run the apache2 service.
$ sudo service apache2 restart
or
$ sudo /etc/init.d/apache2 restart
If it works !! You are champ.For me ,It throws an error --
codeleaf@dotorbit-backbox:/media/Development/Developer/HEROKU/DotOrbit$ sudo service apache2 restart
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
I googled about it and found the solution,By default "httpd.conf" file will be blank. Now, simply add the following line to the file.
$ sudo gedit /etc/apache2/httpd.conf
Add the following line to "httpd.conf" and save it .
ServerName localhost
Now restart the server.
$ sudo service apache2 restart
$ * Restarting web apache 2 server
... waiting
Woohoo.. It works
step3 - Test whether PHP is working or not ? Create "test.php" in /var/www/ directory.
$ sudo gedit /var/www/test.php
and add following line "
< ?php phpinfo(); ? >
step 4 - Test localhost/test.php and you will get the info page. e.g "PHP Version 5.3.10-1ubuntu3.4"
No comments:
Post a Comment