Help - Search - Members - Calendar
Full Version: Php
BleepingComputer.com > Software > Programming
   
darkdreamer
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. sad.gif

Can someone help me?
lucent
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:

QUOTE
<?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.
_Peter_
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.
darkdreamer
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
_Peter_
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.
darkdreamer
ok I uninstall the apachefriends

and installed php5.2.1 and apache2.0.59

can you help me conf it?
_Peter_
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.
darkdreamer
installed it on C:\Program Files\PHP



I can't find a file with the name "php.ini-dist" but I guess it is a configuration file
_Peter_
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.
TehWabbit
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 smile.gif 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.
nash159
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.
Nikas
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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.