What is the easiest way to practice PHP on Ubuntu?
I am learning PHP and I'm l开发者_运维知识库ooking for the simplest way to run practice scripts. I already have netbeans installed.
from synaptic or from terminal you need to install apache2, php5, phpmyadmin, mysql-server for working with php,then type http://localhost/ in browser it shows "it works"
"place your php scripts in /var/www folder with an extension of .php" like 'example.php', 'welcome.php'
Install LAMP: sudo apt-get install lamp-server^
(be sure to use the caret), it's a breeze (at least in Ubuntu 10.10). Installs Apache and mysql automatically.
Then open up NetBeans, set the root to the /var/www root folder and off you go!
I did it not much time ago and it took me 20 minutes in all (if you install phpmyadmin, be careful 'coz sometimes it creates a symlink in /usr/share instead of a link in the root /var/www, that took me most of the time to figure out)
Install LAMPP: http://www.apachefriends.org/en/xampp-linux.html
It includes apache server, php, mysql, even phpmyadmin already bundled. Pretty easy to setup, just follow instructions.
sudo apt-get install php5-dev mysql-server apache2
password
hit [y]es
go to http://localhost/
write code in /var/www/
精彩评论