Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Php


  • Please log in to reply
11 replies to this topic

#1 darkdreamer

darkdreamer

  • Members
  • 4 posts
  • OFFLINE
  •  
  • Local time:04:47 AM

Posted 20 February 2007 - 10:43 AM

I'm currenly learning PHP but I don't know how to test it.
I tried everything what is on the official php site but still no result. :thumbsup:

Can someone help me?

BC AdBot (Login to Remove)

 


#2 lucent

lucent

  • Members
  • 172 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:11:47 PM

Posted 20 February 2007 - 08:48 PM

Hello darkdreamer, What OS are you using? If you are using a linux variant you can create a php document in the /var/www/ folder or which ever folder you have set as the web root. Call the document test.php and put the following into it:

<?php phpinfo(); ?>

You may need to set your permissions and make it executable depending on your server. Then just head on over to the file with your browser.

If you are using windows someone else may need to help you out as I'm on my linux box at the moment and my memory is a bit shoddy..... But look for your root www folder and drop the same file into it. Then point your web browser to it.
If this fails to work and all you see is the line you entered, something is amiss..... you may need to post back you OS, webserver version, php version and some configuration details, as much as you can find would be best.
Hope this helps.
Cheers, Lucent.

Edited by lucent, 20 February 2007 - 08:52 PM.

Posted Image
Special thanks to efizzer for the signature

#3 _Peter_

_Peter_

  • Members
  • 22 posts
  • OFFLINE
  •  
  • Local time:10:47 PM

Posted 22 February 2007 - 01:09 AM

Here's another question, what web server do you have on your computer? If you have Apache 2 and PHP 5.0, I might be able to offer you some help getting it set up.

#4 darkdreamer

darkdreamer
  • Topic Starter

  • Members
  • 4 posts
  • OFFLINE
  •  
  • Local time:04:47 AM

Posted 22 February 2007 - 05:02 AM

I'm using windows
got something that is called apachefriends (but don't know how to use it)
and got a file named PHP in my /C: , I think it's 4.0

#5 _Peter_

_Peter_

  • Members
  • 22 posts
  • OFFLINE
  •  
  • Local time:10:47 PM

Posted 22 February 2007 - 04:53 PM

I'm asking because I was able to successfully install Apache 2, and PHP 5.0 on my computer. I've never heard of Apache friends before. I recommend that you download and install Apache 2, and PHP 5.0, and follow the instructions for installation, because you can find alot more support, and better instructions for those programs. I think those are still the latest versions. Plus I can give you good instructions for getting that stuff installed.

#6 darkdreamer

darkdreamer
  • Topic Starter

  • Members
  • 4 posts
  • OFFLINE
  •  
  • Local time:04:47 AM

Posted 23 February 2007 - 06:29 AM

ok I uninstall the apachefriends

and installed php5.2.1 and apache2.0.59

can you help me conf it?

#7 _Peter_

_Peter_

  • Members
  • 22 posts
  • OFFLINE
  •  
  • Local time:10:47 PM

Posted 23 February 2007 - 05:35 PM

I've got Apache 2.0.45, and PHP 5.1.4 on my computer. Here's how I got them both working on mine.

1) Install Apache

2) Did you extract the PHP zip file you downloaded to this directory: C:\php? This is where I have php installed on my computer. If you didn't install php to this directory you will have to modify the lines I'm going to give you later to put in your httpd.conf file.

3) Go to your php directory and find the file "php.ini-dist" and rename it to "php.ini".

4) Go to C:\Program Files\Apache Group\Apache2\conf\. Find the file "httpd.conf", open it, and add the following lines to it...

LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"

#Please remember that if you didn't install php to C:\php, you will have to change these lines so they point to the directory where you have php installed.

5) Now stop the apache web server from running, and start it again, and you should be able to test php scripts in your C:\Program Files\Apache Group\Apache2\htdocs folder.

This is exactly what I did to get php to work on my computer. Give it a try, and good luck.

#8 darkdreamer

darkdreamer
  • Topic Starter

  • Members
  • 4 posts
  • OFFLINE
  •  
  • Local time:04:47 AM

Posted 25 February 2007 - 06:43 AM

installed it on C:\Program Files\PHP


Posted Image
I can't find a file with the name "php.ini-dist" but I guess it is a configuration file

#9 _Peter_

_Peter_

  • Members
  • 22 posts
  • OFFLINE
  •  
  • Local time:10:47 PM

Posted 25 February 2007 - 01:33 PM

Alright, I think you can skip step 3. That file in your picture must be the PHP configuration file. In previous versions of PHP like the one I'm using you had to rename the configuration file to php.ini. I guess you don't have to do that anymore.

#10 TehWabbit

TehWabbit

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Local time:04:47 AM

Posted 11 April 2007 - 02:12 PM

Use instantservers for windows, you install the basic file which will give you a directory which is your HTTP folder, from here you can isntall addons like php, SQL etc, many versions of each also available

http://instantservers.com/miniportal.html <- instant server "Miniportal" this is the main file you'll need.

http://instantservers.com/download/minip.exe or theres the direct link to the download.

Also.. the plugins i mentioned:
http://instantservers.com/plugin_mp/plugins.html

i can say that this is easy to use and when you have most the addins on its good for home testing :thumbsup: plus you can tweak most settings with the ACP (including adding your own domain to your IP)

i think some settings require you to have a static IP, but im pretty sure you can run it for php testing without one.

#11 nash159

nash159

  • Members
  • 4 posts
  • OFFLINE
  •  
  • Local time:11:47 AM

Posted 18 April 2007 - 03:11 PM

Vertrigo could help you. Its got everything commonly needed to test/run php.

http://vertrigo.sourceforge.net/

Install it, run it and use the systray icon to start/stop the apache server, view the web root folder etc. Its even got shortcuts to all the configuration files if u want to manually tweak them. Very handy.

#12 Nikas

Nikas

  • Members
  • 650 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Singapore
  • Local time:11:47 AM

Posted 24 April 2007 - 11:04 AM

Are you using Apache Friends now ?

If so, it basically have included all the files needed to run php in your localhost server.

The root folder by default would in C:\Program Files\xampp\htdocs\

Apache and mySQL should be automatically started.

After you have installed, open your browser and type http://localhost/ and press enter. You should see the xampp homepage.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users