LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PHP Help (https://www.linuxquestions.org/questions/programming-9/php-help-880976/)

blakey 05-16-2011 05:54 AM

PHP Help
 
I would like to start learning PHP and have installed apache2, php5, and libapache2-mod-php5 from the command line. I then opened up Firefox and typed: http://localhost and got the reply, It Works! But i can't find PHP in the main Ubuntu menu (i am running Ubuntu 11.04) and i can't start it from the command line? Would someone help me out here please!

EricTRA 05-16-2011 05:56 AM

Hello,

Create a file named index.php in your document root (/var/www?) and put the following in it:
Code:

<?php

// Show all information, defaults to INFO_ALL
phpinfo();

?>

Then access the page at http://localhost/index.php. If PHP is installed correctly you'll notice.

Kind regards,

Eric

corp769 05-16-2011 06:00 AM

Hello,

To add to what Eric said.... PHP is a programming language, and the packages you have installed just add PHP capabilities to apache, which is your web server. As far as the language itself goes, here are a few references and tutorials to start:
http://php.net/manual/en/tutorial.php
http://www.w3schools.com/php/php_intro.asp
http://devzone.zend.com/article/627

Hope that helps man!

Cheers,

Josh

blakey 05-16-2011 06:30 AM

Thanks for the help plus links EricTRA and corp769. Shall really get stuck in now and learn all i can. Cheers!

corp769 05-16-2011 06:32 AM

Cheers dude! If the information we provided is good enough, you can mark your thread as solved and give rep if applicable. If not, leave it open and you can always come back ask away again :p

Josh


All times are GMT -5. The time now is 04:14 PM.