View Full Version : View/Testing PHP
phizikal
June 20th, 2007, 05:04 AM
Ok, I am currently working on a website. I wrote a emailer script and a MD5 hasher, but I am new to ubuntu. I would test these on a web host, but I currently don't have money, and I also have some scripts that violates the terms of free host companys.
Is there anyway I can test these files on my own computer without a host.
Please and thank you's!
scribles
June 20th, 2007, 05:34 AM
Yes you can.
Install Apache, PHP and any other modules you need.sudo apt-get install apache php5
Put your files in /var/www
Point your browser to http://localhost/
phizikal
June 20th, 2007, 05:39 AM
Okay, I tried using that command to install it. And I got an error.
Reading package lists... Done
Building dependency tree... Done
Package apache is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package apache has no installation candidate
scribles
June 20th, 2007, 05:42 AM
opps... try
sudo apt-get install apache2 php5
phizikal
June 20th, 2007, 05:44 AM
Yummy! Thanks my friend.
Much appreciated,
phizikal
June 20th, 2007, 05:45 AM
BTW, it is saying I do not have permissions to copy to the WWW folder.
Sorry about that... =/
scribles
June 20th, 2007, 05:55 AM
you have 3 options
use sudo to copy files into the folder as root (yuk) sudo cp filename /var/www/
make yourself the owner of /var/www (only a good idea on a testing only server) sudo chown username /var/www
or configure apache so that is serves files from a different folder. this is the best option but more time consuming.
phizikal
June 20th, 2007, 06:19 AM
Thank you.
Is there a way I can have permissions on everything? I dont wanna have to manualy make myself the owner on every file.
phizikal
June 20th, 2007, 06:30 AM
Also, you know how I can set up a mySQL database?
scribles
June 20th, 2007, 06:35 AM
The file system permissions are one of the things that make Linux very secure. One of the reasons viruses / spyware do so much damage to Windows is because most people do everything as Administrator which is very unsafe. I recomend that you give using sudo to elivate your privleges and chmod / chown to change permission only when you have to a chance. It won't take long before it seems second nature and you will be much better off for it.
phizikal
June 20th, 2007, 06:38 AM
Mmmk, I understand that now.
And about setting up a MySQL database?
Occasionally Correct
June 20th, 2007, 06:41 AM
Also, you know how I can set up a mySQL database?
I used this article (https://help.ubuntu.com/community/ApacheMySQLPHP) when I was setting up a small testing server on my computer. It's a bit of a read, but it went by pretty quickly and it worked very well. :)
scribles
June 20th, 2007, 06:43 AM
sudo apt-get install mysql-server php5-mysql will install the server and the mysql plugin for php. also phpmyadmin is handy for managing databases
sudo apt-get install phpmyadmin
phizikal
June 20th, 2007, 06:45 AM
um the second command didn't install correctly.
=/
scribles
June 20th, 2007, 02:26 PM
Do you have the Universe repository enabled? If not take a look at https://help.ubuntu.com/community/Repositories/Ubuntu
vBulletin® v3.8.0 Release Candidate 2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.