Setup problem: So Apache doesn't like PHP...<

liunx

Guest
I'm trying to set up an offline Apache server, following the instructions at <!-- m --><a class="postlink" href="http://www.thesitewizard.com/archive/php4install.shtml">http://www.thesitewizard.com/archive/php4install.shtml</a><!-- m -->. But when I tried to restart the Apache service to accept the new stuff in httpd.conf, it wouldn't start. I've found this to be because of the line

LoadModule php4_module "d:/web/php/sapi/php4apache.dll"

(even when it's commented out!). If I miss this step, the test page of <?phpinfo()?> doesn't work. So what do I do now?Just forget about that load of crap--
I didn't even bother to read to see if its correct or not.

**HOW TO INSTALL A WORKING SERVER W/ PHP**
1) Download & Install Apache 1.3.x (x = latest #)

2) Download & Install PHP 4.3.x (x = latest #)

3) You *should*, if you did Apache then PHP,
be able to restart Apache, then see PHP work.


**HOW TO GET .PHP/.PHP3/.PHTML FILES TO SHOW**
1) Put all files in the 'htdocs' folder,
inside the apache folder; default its
something similiar to this--
C:\Program Files\Apache Group\Apache\htdocs

2) Visit 'http://localhost' in your browser
to view your offline server.

Hope it works, if not post back
and tell me what it said and I'll
try to help, or an (probably more so) talented member :)1) Put all files in the 'htdocs' folder
What do you mean by this?
<!-- m --><a class="postlink" href="http://localhost">http://localhost</a><!-- m --> works, but <?phpinfo()?> still doesn't - it just gets literally translated.where did you install Apache?
If its default, then its--

C:\Program Files\Apache Group\Apache\htdocs\

If its something else, go where
you installed Apache, and look for the
folder 'htdocs'.

Place your .PHP files HERE
to be processed like PHP.I've installed Apache in: d:\web\Apache\Apache2\

Then I realised I should be using php4apache2.dll! But it still didn't work. Thrilling...Are you sure you added this to httpd.conf:

AddType application/x-httpd-php .phpI have now, but it STILL isn't working! :crying:if you installed apache than php, it should configure apache's http.conf file for you.what about just testing files that why can't you save php files anywhere?Originally posted by Thamior
what about just testing files that why can't you save php files anywhere? What?Originally posted by Thamior
what about just testing files that why can't you save php files anywhere?
you can't because the php files require a server to parse which lives in only 1 folder and anything below that folder.*cry*Okay: I installed Apache after PHP, which looks like the bad move. Thing is, I'm getting a new hard drive soon and I'll be repartitioning and starting again so there's not much point trying now. Once I'm back up again I'll try installing PHP after Apache and give that a go.hmm; well I'm not all that
sure bout the apache...

what version is it?
what version is the PHP? etcyes it is. you have to install apache first, then php. doesn't matter what version you have. php will configure apache for you. if you are using the installer.I'll try that, I've got an old machine running ME I can test it on.

--EDIT--
wha-? It said the code for modifying httpd.conf hadn't been written. :confused: (Apache v2.0.49, PHP v4.3.6)PHP does not yet fully support Apache 2.x.x

Leonisknovo wrote this:
1) Download & Install Apache 1.3.x (x = latest #)

You need to get the 1.3.x to have php auto-configure apache. If you get 2.x.x, you have to redo the conf file on your own. It's not too hard, and there is some good info on what you need to do in the php manual: <!-- m --><a class="postlink" href="http://www.php.net/manual/en/install.apache2.php#install.apache2.windows">http://www.php.net/manual/en/install.ap ... e2.windows</a><!-- m -->
Follow the directions to install as a module.

From my experience, php says that it does not yet support Apache 2.x.x, but it seems to work fine, and it's been stable for me. If you're looking for the EASIEST way to do it though, simply follow the steps that Leonisknovo gave you.Well I followed the instructions in scoutt's ticky thread and finally I'm back to the original situation where Apache works and PHP doesn't. It just absolutely refuses to do what I want it to. WHY? Stupid Apache... :angry: :crying:why?

what version of apache and what version of php?

what is the address you are using in the location bar?

also where are your php files located when you do this?Apache v1.3.31
PHP v4.3.6 (zip version).
PHP files in the htdocs folder.
Windows 2000.
Everything should work, but it doens't!

Okay, I've got one last idea. I'll put the <?phpinfo()?> test page on my website's server, see what that does.if you followed my tutorial it should work. I know it works cause I just got done doing it right before I wrote it.

now, did you edit all the paths to the dll for php that apache will use?

it is not a good idea to put php in your web folder, I would move it one folder up so at least it is not at root.Oh yeah, it works on my website's server... <!-- m --><a class="postlink" href="http://www.wiffles.net/server/dirty4.php">http://www.wiffles.net/server/dirty4.php</a><!-- m -->

This makes absolutely no sense. The LoadModule line points to the PHP module. The PHP module's there, the path's right, but it STILL doesn't find it. Even if I copy it into the Apache folder, it STILL can't find it!

I hate Apache now. As a last attempt, I've uploaded my httpd.conf file. %*^*%*^*^stupidapachenotworking%&$*^*(

<!-- m --><a class="postlink" href="http://www.wiffles.net/server/httpd-evil.txtif">http://www.wiffles.net/server/httpd-evil.txtif</a><!-- m --> this is just for testing then why not just use Easy php (<!-- m --><a class="postlink" href="http://www.easyphp.org">http://www.easyphp.org</a><!-- m -->) and follow the instructions there, it gives you apache 1.3.x php 4.x.x PHP my admin and mysql

all designed for a win32 platform

I tried what you are doing and it just seemed to not want to work for me but as soon as i installed easyphp it worked straight away

hope this helpsyou have the slashes going the wrong way

LoadModule php4_module c:/php/php4apache.dll

change those around. the php4apache.dll has to be in the same directory as php.exe, apache doesn't have anything to do with it.

you have to follow my tutorial to the tee. and I see you didn't.

ServerName <!-- w --><a class="postlink" href="http://www.localhost.net">www.localhost.net</a><!-- w -->

should be

ServerName localhost

then when you run php you have to have them in your htdocs folder as that is your www folder. so,

<!-- m --><a class="postlink" href="http://localhost">http://localhost</a><!-- m --> or <!-- m --><a class="postlink" href="http://127.0.0.1">http://127.0.0.1</a><!-- m --> BOTH point to htdocs. ALL php scripts have to be in there.Changes made. Still isn't working. I can interpret <?phpinfo()?> from a DOS prompt, so that's at least something... What am I not doing right?can you update that httpd.conf file for us? also did you restart apache after you made the changes?http://www.wiffles.net/server/httpd-evil2.txt

Quick question: How do I restart Apache if it doesn't come up as a service? (To make sure this wasn't the problem I restarted the whole PC but it didn't help)well it appears to be ok. I noticed you had 2 of these line

AddType application/x-httpd-php .php

you can deelte one, preferably th ebottom one.

the only way you can restart apache is to type "quit" and then start it again. I will look more when I get home.btw scoutt, I think you need to mention in your tutorial that extension_dir goes in php.ini, not httpd.conf.thanks, can't believe I had it in there or what I was thinking.

ok, on your conf file on line 616 you have this:

ScriptAlias /php/ "c:/php/"

delete that line.

and on line 868 you have this

Action application/x-httpd-php "/php/php.exe"

make it like this instead

Action application/x-httpd-php4 "/php/php.exe"

I added a 4 to it.

that should do it so restart apache and it should work.Changes made. And guess what? It still isn't working.ok, tell me how exactly how you are seeing if it is working? what do you get? how are you doing it? are you getting a Download box?Okay.

<!-- m --><a class="postlink" href="http://localhost">http://localhost</a><!-- m --> works fine.
If I run php.exe with <?phpinfo()?>, the command line gets filled with the processed HTML.
But if I start Apache then try to browse the PHP file, it doesn't do what it should. In Mozilla it doesn't show anthing and in IE it shows it as pain text (but I think that might be because of some double-click actions I messed up, that's why I installed Mozilla onto this machine). No Download box or anything like that.ok, the file that has this in it

<?phpinfo()?>

has to be in your htdocs folder. then you would do this

<!-- m --><a class="postlink" href="http://localhost/phpinfo.php">http://localhost/phpinfo.php</a><!-- m -->

if phpinfo.php is the file name you have with phpinfo in it.

also try

<!-- m --><a class="postlink" href="http://127.0.0.1/phpinfo.phpIt">http://127.0.0.1/phpinfo.phpIt</a><!-- m --> seems to me that if <!-- m --><a class="postlink" href="http://localhost">http://localhost</a><!-- m --> works, then you are good. Even if the files ARE in your htdocs folder, and EVERYTHING is installed correctly, you can still ONLY access them via localhost or 127.0.0.1...you cannot browse to a file and open it.Even if the files ARE in your htdocs folder, and EVERYTHING is installed correctly, you can still ONLY access them via localhost or 127.0.0.1...you cannot browse to a file and open it.
That's probably what it is! I'm too tired now, but I'll give it a shot tomorrow...I am an idiot :o

It works! It finally works! Cheers dudes, thanks for putting up with my stupidity, using file:/// instead of localhost...Originally posted by wiffles
I am an idiot :o

It works! It finally works! Cheers dudes, thanks for putting up with my stupidity, using file:/// instead of localhost...
:cool: but I told you that 4 days ago.but I told you that 4 days ago.

...oh yeah. As I said before, I am an idiot
 
Back
Top