Jump to content
xisto Community
Sign in to follow this  
lonebyrd

Do I Need To Install Something For Php

Recommended Posts

I want to use PHP in my website but do I have to have a special program to run php on my computer. I know there was Apache for something but for the life of me I cant remember what that was for. If I need Apache, can someone tell me how to install it. I had a hard time doing it on my last computer and don't know what I did wrong.

Share this post


Link to post
Share on other sites

Apache is just a web server application. What you want is a webserver with PHP module included to run php so I would suggest you go the easy route and install "wamp" http://www.wampserver.com/en/ or xampp for OS X if you happen to be using that.

 

They are quick installers and provides almost everything a common web developer needs to start building without worrying about the long process of installing them manually.

Share this post


Link to post
Share on other sites

You have to install a web server like Apache, PHP and MySql(for database connecativity). So the best option is to install the WAMP server(assuming you are using Windows) as sonesay suggested. WAMP is very easy to install and configure. Download and imstall the wamp server from here. After installation start your webserver, and then open your browser and type LOCALHOST. This will show you the default home page of wampserver. This indicates that your installation is correct. To test your own php files, create your php files in WWW folder in the wamp directory. and point your browser to LOCALHOST/yourfilename.php

 

First try this and ask us if you have any other doubts. :P

Share this post


Link to post
Share on other sites

I have a couple of tutorials on how to install an Apache server with PHP and MySQL support manually on my site: one for Windows and one for Linux. They are a bit out of date, but they can still provide insight on certain matters.

Share this post


Link to post
Share on other sites

O.K. I installed Wamp but I have a question. You said test pages using the www folder. I made a quick folder called hello in the www folder to just check out the echo hello function but all it did was make a folder. How do I use wamp? It is a little confusing to me. Do I just open this folder and put in my script then open it? What exactly do I have to do? It's been a while since I've used things like this. I'm just getting back into programming so sorry if these seem like stupid questions.

Share this post


Link to post
Share on other sites

well don't need to make any additional folders, thats just to keep things tidy and organized. You can just place your php files inside the www directory and it will run if you have the web server started and there are no errors.Viewing your php file - After you have placed the file in the www directory you need to open up a web broswer and enter your web servers address. In this case it whould be lhttp://localhost Still lost? post where your lost at exactly.

Share this post


Link to post
Share on other sites

O.K. I installed Wamp but I have a question. You said test pages using the www folder. I made a quick folder called hello in the www folder to just check out the echo hello function but all it did was make a folder. How do I use wamp? It is a little confusing to me. Do I just open this folder and put in my script then open it? What exactly do I have to do? It's been a while since I've used things like this. I'm just getting back into programming so sorry if these seem like stupid questions.

if you want to use with folders in www folder directory, I give you an example

First make folder named test in www folder directory. You can replace your own folder name where is test.

Make sample file like test.php in that folder(test) you can change file name what you like.

Before you testing start wamp server going to start-programs-wamp server.

Open your browser then type LOCALHOST/test/test.php

definitely you will see your page what u coding on test.php.

If you having problem post here.

Share this post


Link to post
Share on other sites

wamp is a bit tricky ,

first you have to start the server, go on wampp icon in the windows tool bar right click and select start wamp server ,

see if your port 80 is open : on the wamp icon in your tool bar press right bottom of the mouse go to apache and click on test port 80, if port 80 is not available go to wampp/apache , edit httpd.conf find the section which says LISTEN 80 change it to something else from 1 to 10000 or was it more ? anyway you got plenty of choices for ports, restart your wamp server by clicking on the icon in the windows tool bar with right mouse button and select restart wampp server or stop and then start wamp server.

go to LOCALHOST. You should see a web page there wich says that apache is running. There after remove index.html or index.php in your htdocs folder, make one file test_php.php place into the file the following text "<?php phpinfo();?> navigate to LOCALHOST click on the file test_php.info if you see a nice screen with all php configurations in it then you got it running.

you can read a step by step on the wamp forums->wamp step by step .

I personaly prefer xampp as it is more stable and easier to work with.

for the xampp installation and configuration visit apache friends

Edited by SofiaComp (see edit history)

Share this post


Link to post
Share on other sites

I too prefer xampp, no nonsense and perfect for me!

If you wish to try xampp simply google it, download the WINDOWS version (they do linux etc... too so dont get the wrong one!!) download and install. From this point on whenever i say "your server" it means either WAMP or XAMPP, whichever you have.

Ok start your server, double click on its icon or go through the start menu. If given a choice start the "apache" service. Your server will probably give you a message like "Apache started (80)" or similar.

Now, in XAMPP the "live" folder is called "htdocs" on WAMP i understand it to be "www" Imagine this folder like a window. this is the ONLY folder that is visible through your browser. Any folder below it is never, ever seen by the user. You can place folders inside this folder however like www/myfolder/mysite or htdocs/myfolder/mysite and they are visible, but anything outside of htdocs or www is not visible. So make a simply php file. Open your text editor (notepad will do) and type:

<?phpinfo();?>

save it as info.php and place it inside the www or htdocs folder, depending what server you have installed.

Now opwn your browser. Type in the address bar: http://forums.xisto.com/no_longer_exists/ OR: LOCALHOST it doesnt matter which.

You should now be shown the "Apache is working!!!!" type message.

Now add "info.php" to the address so you have something like http://forums.xisto.com/no_longer_exists//info.php go to that address and you should be shown a long list of information with a title like "Php info"

If this is so then you are all set up and working!!! You can delete all the files inside the www or htdocs folder and from now on its your own server, only you and other people on your network can see it, no-one on the internet can. So test your stuff out and when its time to publish it get hosting with T17 or another company!

Share this post


Link to post
Share on other sites

A quick note, if you have Windows and will use Easyphp, and don't use the Inetinfo process, you should stop it manually before running the program (I tried choosing a new port but it seems it didn't want to work either, had to do this).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.