PHP server working, PHP files still not working

Forum for you who has PHP installation issues

Moderators: macek, egami, gesf

graciedee
New php-forum User
New php-forum User
Posts: 7
Joined: Sun Jan 09, 2005 6:21 pm
Location: Australia

PHP server working, PHP files still not working

Postby graciedee » Sat Jan 22, 2005 5:14 pm

:shock: I've just read Alexei's guide (thankyou for referring me Alexei!) about configuring PHP4.3.7 to work with Apache2; I've also read the official PHP documentation as was included in the zip file; as well as a PHP handbook I bought from a newsagency.

Unfortunately, despite the fact that the server still acknowledges the PHP module (using LoadModule and AddType), I can't view any PHP files via http://localhost. The server reads them as "whatever.php.txt" and opens them either as a Notepad file or as an Internet page with the code still there.

Every FAQ page I've visited, including that which is on the official PHP site, simply says: "If nothing happens, then something has gone wrong with configuration. GO back and check against installation instructions."

Problem is, it doesn't tell me WHAT went wrong with configuration; and as for checking against installation instructions, I've done that about ten times, to no avail.

I really, really need help. Thank you.

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Sun Jan 23, 2005 3:08 am

okej... lets see.. :-)

CAn you Copy-Paste AddType lines that you are using?
You did copy a php4ts.dll to a WINDOWS folder and did the same with php.ini right?

i think you wrote that you had copied it to some other folder.. php4ts MUST be in C:\WINDOWS

graciedee
New php-forum User
New php-forum User
Posts: 7
Joined: Sun Jan 09, 2005 6:21 pm
Location: Australia

Hi again

Postby graciedee » Mon Jan 24, 2005 3:49 am

I copied php4ts.dll to the C:/Windows folder, along with both the C:/Windows/System and C:/Windows/System32 folders, just for good measure. I did the same with php.ini, too.

Code: Select all

# add PHP capabilities
LoadModule php4_module "C:/php/sapi/php4apache2.dll"
AddType application/x-httpd-php .php


As before, the http://localhost acknowledges PHP 4.3.7 (where it says Apache 2.0.49 (Win32) / PHP 4.3.7, but the actual Notepad files I saved as .php are still seen as .txt files.

I also added the following to the php.ini file, as I was instructed by some handbook:

Code: Select all

doc_root "C:/Program Files/Apache/Apache2/htdocs"
extension_dir "C:\php"


Thanks heaps for your help. :)

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Mon Jan 24, 2005 4:27 am

wel. those 2 last lines that you have added to php.ini are actually suppoed to be altered and not added as they are present in php.ini...

the notepad files that are saved with .php extension will be shown as text files in case you forgot to add <?php in the beginning and ?> in the end of a code... however note that if your windows system doesnt show known extentions: that will be impossible to alter an extentions...therefore you need to enable "show know extentions" in Windows explorer settings..

And make sure that yo restart apche after all modifications to php.ini and httpd.conf

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Re: Hi again

Postby ruturajv » Mon Jan 24, 2005 7:19 pm

graciedee wrote:I copied php4ts.dll to the C:/Windows folder, along with both the C:/Windows/System and C:/Windows/System32 folders, just for good measure. I did the same with php.ini, too.

Code: Select all

# add PHP capabilities
LoadModule php4_module "C:/php/sapi/php4apache2.dll"
AddType application/x-httpd-php .php


As before, the http://localhost acknowledges PHP 4.3.7 (where it says Apache 2.0.49 (Win32) / PHP 4.3.7, but the actual Notepad files I saved as .php are still seen as .txt files.

I also added the following to the php.ini file, as I was instructed by some handbook:

Code: Select all

doc_root "C:/Program Files/Apache/Apache2/htdocs"
extension_dir "C:\php"


Thanks heaps for your help. :)


While saving in notepad save them as "phpinfo.php" do not forget to add the quotes ...
I think they are saved as phpinfo.php.txt files and not phpinfo.php

graciedee
New php-forum User
New php-forum User
Posts: 7
Joined: Sun Jan 09, 2005 6:21 pm
Location: Australia

IT WORKED!!!

Postby graciedee » Tue Jan 25, 2005 2:18 am

Thank you SO MUCH!

I had no idea you were supposed to use the quotation marks, but I'm glad I do now, because it WORKED! (I'm very excited, as you can tell).

Thanks everyone for your help...you have no idea how grateful I am. :-D :-?

surfthewebph
New php-forum User
New php-forum User
Posts: 5
Joined: Sat Apr 23, 2005 10:08 pm

Postby surfthewebph » Sat Apr 23, 2005 10:16 pm

i am having the same problem. php files only open the code in wordpads.

i have modified the doc_root variable in the php.ini files from:

doc_root =

to

doc_root = c:\apache\htdocs

i still ge the same result.

if i understand the thread correctly, i should only put quotations around the path. let me try this, and i'll get back to you. :D

surfthewebph
New php-forum User
New php-forum User
Posts: 5
Joined: Sat Apr 23, 2005 10:08 pm

Postby surfthewebph » Sat Apr 23, 2005 10:23 pm

guess what? it didnt work! 8O

i'm still taken to the http://localhost/localstart.asp file when i trype
http://localhost on the address bar.

and the php files sitll open on wordpad. sigh.

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Sun Apr 24, 2005 12:21 am

surfthewebph: quotation marks maybe :P

plus defining a directory index..

surfthewebph
New php-forum User
New php-forum User
Posts: 5
Joined: Sat Apr 23, 2005 10:08 pm

Postby surfthewebph » Sun Apr 24, 2005 4:18 am

alexei: thanks for the reply. i also tried enclosing the directory index in quotes like this:

extension_dir "C:\php"
but it still didn't work.

I don't know if this would work, bu I remember doing this before I learned that I need to install a PHP server on my machine: I shift-right clicked on a .php file, and set it to always open this type on MS Internet Explorer. I did this because it always opened on Macromedia Dreamweaver. But when I did this, it only looped to open a blank IE infinitely. Then I shift-right clicked on it again, and this time, I specified it to open on WordPad.

Now that i have installed PHP, (I have Apache Tomcat 5 running as service), the .php files still open on Wordpad. If i drag and dropped the .php file on Internet Explorer, it still opens the file on Wordpad.

I wonder if Graciedee did the same thing (specifying it to open on Wordpad) and how she was able to finally fix this issue.

thanks.

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Sun Apr 24, 2005 5:20 am

Try looking at our guides how to configure Apache and PHP in PHP installation forum... those stickies.. i recall posting some guides how to do that..

surfthewebph
New php-forum User
New php-forum User
Posts: 5
Joined: Sat Apr 23, 2005 10:08 pm

Postby surfthewebph » Sun Apr 24, 2005 7:26 am

ok, thanks alexie. :)


Return to “PHP Installation”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest