Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Andrzejek on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Completely php newby asks for your help 3

Status
Not open for further replies.

skarosi

Programmer
Jan 25, 2004
140
GR
Hi all,
most likely this is been asked before, but i am not sure how to search for this on the forum.
I am completely new to php, but i would like to start and learn some things, in case i need it. I have some free time at my hands at the moment:)

anyhow, i searched the web, and the only think that i realy got was that in order for me to write something in php, i need an sql server and a web server running.

Is this the case? cant i just start writing a webpage localy like i would do using html?

I am using Linux, something else i am new at, and i think that there is apache running there, but i am not so sure about an sql server.

do you know any place that i could have a look and get me into it?

thanks alot,
ilias
 
I'm no PHP expert and I'm sure you'll get better responses on this forum than from me, but you don't need a mySQL 'server' to run/learn PHP. You only need that if your PHP is going to interact with the database.

And your linux server will probably come with PHP installed on it.
You could create a simple file called 'phpinfo.php' with the following code in it:

Code:
<?php
phpinfo();
?>

This will tell you if PHP is installed on your server.
 
i reckon i am fairly expert in php these days. and i agree with d0nny.

 
That is some good news!
I did create that file, but when i try to open it with firefox, i get the download window, and i cant open the file.

Actually, is there any program that would help me write php, having graphical items ready to use for example, or i have to do everything by text?

 
You will need to ensure php is installed on your linux box.

For example on redhat based distro's you can "yum install php". Apache is the webserver however you still need the PHP interpreter to present your PHP files.


 
Could you tell me how i would check if i do have php installed?
I have Ubundu 7.1

thanks
 
a simple test would be to open a terminal window and type in this command

Code:
php -v

it should report what version and type of php you have installed.

ubuntu comes with an installer (synaptic, i think). it will be in the system -> administration menu.

or you can always use apt-get from the terminal.
 
Also how are yo trying to open the file?

Since PHP relies on the server it needs to be opened via the server.

Using the File->Open option form withing firefox would not work.

Yo would need to call the file via a url. In the case your webserver is local, it would be something like:

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I think it would be helpful for you to learn what a LAMP server is. (google it) Linux Apache Mysql Php. I got a lamp server thru godaddy.com for a decent price and it was ready to go (although I've built lamp servers on my own in VMware before). Good luck on your PHP journey!
 
Wow! information overflow!
first thing first.
jpadie, php was not installed on my pc, I will have to do that.

vacunita, I was trying to open the file from the open menu, but since there was no php running, i suppose that it wouldnt make a diference.

sen5241b, I havent heard of lamp b4, but i do know about easyphp and wamp, for windows, which i suppose is the same thing.

southbeach, I will have a look on sourceforge and see what i can get.

Thank you all guys, I hope i can make this to work!


 
jpadie said:
a simple test would be to open a terminal window and type in this command
Actually, that may not work. Ubuntu ships the command-line PHP interpreter in a separate package, so that may well come back with a "command not found" error even though mod_php works perfectly.

A better way would be to simply ask the package manager. Fire up Synaptic and search for the libapache2-mod-php5 and php5-cli packages. The first is the PHP module for the Apache web server, which should give you a working PHP configuration to play with. The second will give you the command-line PHP interpreter, which you probably won't need right away, but can be a handy thing to have, for instance if you want to write a one-off test script to see how some feature works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top