FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


getting started in php





TurtleShell
I'm not going to apologize for my ignorance, I'm just going to go right out and show it to all the world...

I'm new to PHP. When I say new, I mean, I've never done ANYTHING before and I'm just learning. I need a PHP enabled environment, without downloading Apache (is that possible?). I was hoping that frihost would provide me something like that, but I don't even know what I'm looking for or how to activate it.

I've been scouring the forums for 2 days looking for my answer, but I'm not finding it out there.

Can someone help me?

Alternatively, if there would be some way for me to run PHP scripts (just to test them) without accessing the internet, that would be fine for the time being as well. I need very detailed instructions because I'm a total newbie.
rvec
why don't you want to download apache?
It's a good way to test out your site before uploading it to frihost (which does support php files).

You can start like jtayl153 did here: http://www.frihost.com/forums/vt-87603.html
TurtleShell
I don't have access to the same computer all day every day; it's different computers at different times. I don't want to download apache because I'm not always in the same place. This is why I asked if I can do PHP without downloading anything. For the time being, it's just not practical. You say that frihost supports PHP files, but how do I get them to work once they've been written?

btw, thanks so much for your help.
rvec
Quote:
a fully powered webserver you can take with you on a USB Stick or even your camera's flash drive.

http://www.uniformserver.com/

There's always a solution Wink

Did you put html files on frihost before? It's almost the same. PHP is already activated, the only thing for you left to do is upload the php files (just like html) and direct your webbrowser to the files. To test this you can make this script:
Code:
<?php
echo "Hello world";
?>

Put that in a file which name should end on .php and put that file on your frihost webspace. Direct your browser to the file and you should see "Hello world" Smile.
TurtleShell
I'm an idiot!! Thank you SO much!

I tried uploading a .php document to frihost earlier and it didn't work. I thought this was because I hadn't downloaded something or activated something or...who knows. Anyway, I checked the script a little bit, didn't see any errors, so I assumed that wasn't the problem, but it turns out, it must have been the original script! I uploaded exactly what you told me to...and it worked.

Is there some reason why I should download apache? Is there something wrong with just using frihost?
rvec
If you download apache with php amd mysql (like with uniformserver) you can try out scripts on your own pc. If you put them on frihost you have to upload them each time you change something, on your own pc you can edit the files in your www dir so you don't have to upload or download anything.

Also by trying scripts on your own pc first there will be less chances of you uploading a problematic script which may use lots of recourses.
TurtleShell
when you say, "uploading a problematic script which may use lots of recourses"...what do you mean by that, exactly?
rvec
something like this:
Code:
<?php
while ($countr < 5) {
  ++$counter;
}
?>


Notice the missing e. This will make an infinite loop and will probably use a lot of resources. If you do this on your own pc your pc will be slow for 30 sec and only you will have problems. If you do this on the server everyone will have a slow server for 30 sec.

BTW it could be worse but this is the most common mistake you can easily find when testing it on your own pc first.
TurtleShell
Interesting. Ok, so I have some questions.

1) Why, if it were not provided for me by frihost, would I need to download PHP? Isn't PHP a scripting language? don't I write PHP myself? So if I need to download it, what exactly am I downloading?

2) What is Apache? It's my understanding that it's a webserver application, but what does that mean? The book I'm reading, which is a visual quick start guide by Larry Ullman says that I need to download PHP, MySQL, and Apache, OR I need a webhosting service that will provide all these things for me. He also says that PHP is a server side language and all scripts must be accessed through a URL, unlike html documents, which you can open in a browser without ever placing them on a server. Does this mean that Apache is providing me with a server, on my computer? It's turning my computer into a server?

by the way, I REALLY appreciate your input. Thanks:)
rvec
TurtleShell wrote:
Interesting. Ok, so I have some questions.

1) Why, if it were not provided for me by frihost, would I need to download PHP? Isn't PHP a scripting language? don't I write PHP myself? So if I need to download it, what exactly am I downloading?

PHP is a scripting language but unlike html the language has to be read by a program on the server. This program is also called PHP and will send the output to the browser as a HTML page. If you try to open a php file with a browser directly it will show the code. If you put a php file on frihost and give it a php extension the server knows it's php code and will send it to the PHP program before sending it to the browser.

TurtleShell wrote:

2) What is Apache? It's my understanding that it's a webserver application, but what does that mean? The book I'm reading, which is a visual quick start guide by Larry Ullman says that I need to download PHP, MySQL, and Apache, OR I need a webhosting service that will provide all these things for me. He also says that PHP is a server side language and all scripts must be accessed through a URL, unlike html documents, which you can open in a browser without ever placing them on a server. Does this mean that Apache is providing me with a server, on my computer? It's turning my computer into a server?

by the way, I REALLY appreciate your input. Thanks:)

apache is a webserver, it will listen on port 80 for a browser to ask for the webpage. If a browser asks for a webpage it will display the webpage in it's web directory. If you put apache on your pc you can also choose to keep it private and only accept requests from browsers from the pc itself (localhost). PHP has to be accessed through a webserver (like apache) with PHP installed on it, if PHP isn't installed it will just try to show the file as a HTML file (just like if you open a PHP file with the browser directly).

Frihost also has apache installed with PHP and MySQL, but if I where you I'd try to understand php before starting with MySQL.
TurtleShell
rvec wrote:
TurtleShell wrote:

2) What is Apache? It's my understanding that it's a webserver application, but what does that mean? The book I'm reading, which is a visual quick start guide by Larry Ullman says that I need to download PHP, MySQL, and Apache, OR I need a webhosting service that will provide all these things for me. He also says that PHP is a server side language and all scripts must be accessed through a URL, unlike html documents, which you can open in a browser without ever placing them on a server. Does this mean that Apache is providing me with a server, on my computer? It's turning my computer into a server?

by the way, I REALLY appreciate your input. Thanks:)

apache is a webserver, it will listen on port 80 for a browser to ask for the webpage. If a browser asks for a webpage it will display the webpage in it's web directory. If you put apache on your pc you can also choose to keep it private and only accept requests from browsers from the pc itself (localhost). PHP has to be accessed through a webserver (like apache) with PHP installed on it, if PHP isn't installed it will just try to show the file as a HTML file (just like if you open a PHP file with the browser directly).

Frihost also has apache installed with PHP and MySQL, but if I where you I'd try to understand php before starting with MySQL.


I couldn't agree with you more--about figuring out PHP before MySQL. Unfortunately, I'm strapped for cash and this is the book I have, so I'm going to keep going with it unless I get so stuck I can't get any farther.

So another question... My understanding from what you're saying is that if I had a website that used PHP, all I'd need is Apache (and PHP and MySQL) on my computer, and I'd be set up to host my own site. Does this also mean that I could do this with any standard strictly html based website? That I don't need to get my webhosting through frihost, or anyone, because I can be my own server that hosts my own html pages? For free?
rvec
yes that's possible.

But you need to have a pc on 24/7 and have enough bandwidth to let all viewers download your site.

I have done something like that myself. My upload is 1mbit and when I use bittorrent (most of the time) my site is slow.
Bluedoll
What a great post and helpful answers. Now I know I am not the only person with questions. This was such great reading, actually learned something. Thank you. That part about slow server does scare me though. Now, I can see an advantage of downloading Apache for testing purposes. Also having your own server even if it is limited seems so cool, so are you guys!

Smile
TurtleShell
This has been VERY helpful for me. I've actually had these questions for weeks but have not been sure what the questions were, if that makes sense. Anyway, I'll be back when I want to know more...
gidevelop
Try killerphp.com. It has all the basics. Try lear from that guy. It has very well explaind video tutorials. Is true thet PHP is not easy at all. Is good not to make high expectations from yourself this my friend is like music. If you don't have the gift is in vain. Try those tutorials see if you get something . BYE !!!
Related topics
Complete Tutorial LINKS for every language
Just Getting Started
Problems with PHP-Nuke on Server2
Help with getting started
Getting Started with Drupal - Tutorials?
[Flash] Corporate menu
FTP Guide
Getting started
What is your age group?
Where else do you go?
Getting Started
Getting Started
I'm just getting started
getting started
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.