TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-29-2009, 11:50 PM   #1 (permalink)
The Wanderer
 
Join Date: Jan 2009
Posts: 16
Thanks: 3
DotNetTim is on a distinguished road
Default Can't get PHP 5. to work? Newbie windows PHP guy

Hello. I installed PHP 5.? Whatever the latest version is on my Windows Vista Machine. I also used Winxamp lite or whatever it's called and it installed ok. The problem is that I tried to use a PHP file in the HTDocs folder and it try's to download instead of showing up in the browser under the local user or local IP. I know from past experience with Classic ASP this is usually because the PHP dll or whatever it is that interpruts the files isn't being used? I tried to install in several directories. I intalled Winxamp / Apache lite in c:\ instead of program files directory. So, can someone tell me what else to do? Oh, I can click on the http file and it gives the ole "it works" message so I know the web server is working. So why not PHP? I'm wanting to use Netbeans as the IDE which I have setup, but obviously that won't work until I get PHP to work for me. Any help would be greatly appreciated. I'm an ex Classic asp developer, so I think I can learn PHP pretty easy, once I get it working.
I also have MySQL 5.+ working as well..
Thanks
Tim
DotNetTim is offline  
Reply With Quote
Old 02-02-2009, 05:12 AM   #2 (permalink)
The Contributor
 
planepixel's Avatar
 
Join Date: Feb 2009
Posts: 28
Thanks: 10
planepixel is on a distinguished road
Default

create a file phpinfo.php
and write following code.
PHP Code:
<?php

phpinfo
();
?>
now save it in htdocs directory.

now go to 'localhost/phpinfo.php'

if you see information regarding php in tabular structure then your php is working fine. if not then php is not configured properly. I hope you are not opening php file from file menu of browser. usually if you try to open using file->open only then it start to download file as you mentioned.
planepixel is offline  
Reply With Quote
Old 02-02-2009, 03:49 PM   #3 (permalink)
The Wanderer
 
Join Date: Jan 2009
Posts: 16
Thanks: 3
DotNetTim is on a distinguished road
Default

Hello.
Thank you for helping. I'm still stuck. I installed "Wamp Server" after un-installing everything, and I mean everything I could that I thought would maybe cause a problem. I then installed the "Wamp Server" which did install, but the browser still tries to open the file and then I get the "Save" dialog. I've been a classic ASP programmer for over 10 years, so I know it's because the PHP interpruter isn't finding the correct DLL or something I'm guessing? So, I'm uninstalling Wamp and going to re-install. I found a post on the web that said if you have Inetpub which I do have this will mess up apache or php, I don't remember. Either way, I have made sure I deleted this directory and made sure that I that IIS wasn't installed which it isn't. So, I'll try again and let you know what I get. I did add these lines to the php.config file to insure that the config file was correct: AddType Application/x-httpd-php .php
LoadModule php5_module “c:/php/sapi/php5apache2_2.dll” but no deals again. Maybe I didn't add them at the right place.

Does PHP run as an ISAPI or CGI or ? I apologize but I don't know much about it yet, but I'll learn in a couple days once I get it configured.

Thanks again, and I'll write back once I get Wamp Server to run again, and I'll run the little function you wrote me.
Thank you
Tim
DotNetTim is offline  
Reply With Quote
Old 02-02-2009, 06:51 PM   #4 (permalink)
The Contributor
 
planepixel's Avatar
 
Join Date: Feb 2009
Posts: 28
Thanks: 10
planepixel is on a distinguished road
Default

I have been using both XAMPP and WAMP for 5-6 months and never faced a problem.before that i had IIS also on my system. so our case is very same but i never faced any problem.

just install any one of them and let me know if problem persists.i hope that it would go away.do not install PHP, MySQL and Apache separately at this stage as you may make mistake while configuring.

these package work straight out of box. you do not have to configure a single thing.just run installer and start developing.

and i also suggest that before you install these make sure you have uninstalled previous versions from your system.
planepixel is offline  
Reply With Quote
The Following User Says Thank You to planepixel For This Useful Post:
DotNetTim (02-04-2009)
Old 02-06-2009, 05:51 PM   #5 (permalink)
The Contributor
 
Join Date: Apr 2005
Location: Kent, UK
Posts: 54
Thanks: 0
Dr John is on a distinguished road
Default

Are you remembering to start the local server first? Pointing a browser directly at a php file without first starting the local server will always just open the file.
__________________
www.kidneydialysis.org.uk
Dr John is offline  
Reply With Quote
Old 02-07-2009, 02:11 AM   #6 (permalink)
The Wanderer
 
Join Date: Jan 2009
Posts: 16
Thanks: 3
DotNetTim is on a distinguished road
Default

Yes, I started the Apache Server, PHP Engine, and mySQL server since it's a service, so all of the above were running. Now, I have WAMP and it serves the PHP pages no problem. The only thing I'm worried about is debugging. It's looking like I might have to do what I used to have to do with classic ASP which is use variables and write them out in certain parts of the PHP scripts to see the values. I hate that, but I don't see how else to do so? I have Netbeans, but someone else on this forum says Eclipse rocks, so I might have to try it..
Thanks so much. I really appreciate it. I just wish I could have gotten it to run without downloading WAMP. I mean I wish I could have setup PHP 5.? and then setup the full free version of mySQL and then setup Netbeans or some other IDE and debugged locally, uploaded using the IDE to make copy of the local files, etc, like I do with ASP.Net which has a killer Copy function for just uploading / ftp'ing to the hosting company. Then I only have to change the connection values, and I do that by code with checking the IP address of the requesting file which is compiled.. That said, I still need to get PHP to work and at least now I have it where I can play with it locally. I just need to decide which IDE to use and learn how to copy my Database which someone else on this forum explained using Dump to copy to the mySQL DB at my host. So, it's going to be fun from here on out. Thanks so much for the help. See other posts if you please..
Tim
DotNetTim is offline  
Reply With Quote
Old 02-07-2009, 10:25 AM   #7 (permalink)
The Contributor
 
Join Date: Apr 2005
Location: Kent, UK
Posts: 54
Thanks: 0
Dr John is on a distinguished road
Default

PHP is designed to run from a web server, to give more power and more interactions for your web pages, that's why you need to use a local server on your PC.

I'd guess your ASP pages were using the built-in IIS of Windows - which is doing exactly the same job as the wamp you installed.

PS PHP doesn't really need an IDE, you can write the code in any text editor just as easily.
__________________
www.kidneydialysis.org.uk
Dr John is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
ffmpeg work with PHP moiseszaragoza Advanced PHP Programming 2 01-02-2009 05:07 PM
ffmpeg work with PHP moiseszaragoza Javascript, AJAX, E4X 5 12-11-2008 02:05 AM
PHP Newbie here ! PixelDawn Member Introductions 14 01-15-2008 05:40 PM
Defining your World: All About Constants Wildhoney General 12 09-18-2007 08:19 PM
Make html pages work like php sam Tips & Tricks 2 02-09-2007 01:00 PM


All times are GMT. The time now is 07:22 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design