Found my extension problem with a new problem...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Rider
Forum Newbie
Posts: 9
Joined: Sun Oct 06, 2002 3:56 am
Contact:

Found my extension problem with a new problem...

Post by Rider »

I did the follow code and it failed to show on my machine:

Code: Select all

<html>
<head>
<title>Today's Date</title>
</head>
<body>
<p>Today's Date (according to this Web server) is
<?php  echo( date("l, F dS Y.") );?>
</p>
</body>
</html>
So, that means that PHP4 isn't working. Well, after going into my install.txt file I noticed:

You need to ensure that the dlls which php uses can be found. The precise
dlls involved depend on which web server you use and whether you want to
run php as a cgi or as a server module. php4ts.dll is always used. If you are
using a server module (e.g. isapi or apache) then you will need the relevent
dll from the sapi folder. If you are using any php extension dlls then you
will need those as well. To make sure that the dlls can be found, you can
either copy them to the system directory (e.g. winnt/system32 or
windows/system) or you can make sure that they live in the same directory
as the main php executable or dll your web server will use (e.g. php.exe,
php4apache.dll).


That confuses me a little. I do run Apache2. I took the .dlls out of the 'sapi' folder and put them with the php.exe and all. But, I think the problem is that when I try to run 'php.exe' it pops up ms-dos puts a new title called 'php' and does nothing.

I did the manual way. Put the php.ini in c:\windows\ and did the extensions_dir = c:\rider\php4\extensions

But, should I take all the .dlls out of 'extensions' and put them in php4 with the original .dlls and the .dlls from the 'sapi' folder?

Thanks for the help.

-Rider
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Have you configured Apache2? And also when you want to view PHP pages you're suppose to run Apache not PHP... :wink:
Rider
Forum Newbie
Posts: 9
Joined: Sun Oct 06, 2002 3:56 am
Contact:

Post by Rider »

Takuma wrote:Have you configured Apache2? And also when you want to view PHP pages you're suppose to run Apache not PHP... :wink:
Apache is running. When I meant 'run php' I meant the auto-install php.exe. So, how would I go about configuring Apache so I can get PHP up and running?

-Rider
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

First of all get the very latest version of PHP from snaps.php.net and copy DLL files etc to %SYSTEMROOT%. Then add these lines to httpd.con (I assume that you've saved PHP in C:\PHP)

Code: Select all

LoadModule php4_module c:/php/sapi/php4apache2.dll
   AddType application/x-httpd-php .php
Rider
Forum Newbie
Posts: 9
Joined: Sun Oct 06, 2002 3:56 am
Contact:

Post by Rider »

%systemroot% would be C:\Windows for WinME?

Also, all dlls are to be copied there?

-Rider
Rider
Forum Newbie
Posts: 9
Joined: Sun Oct 06, 2002 3:56 am
Contact:

Post by Rider »

Even when I put the dlls in C:\Windows and add

Code: Select all

LoadModule php4_module c:/rider/php4/php4apache2.dll 
   AddType application/x-httpd-php .php
At the bottom for the httpd.conf file it still doesn't work. And yes, Apache is running when I view the site.

Is there something really dumb I'm doing? Maybe Apache1 would be better?

-Rider
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Apache 1.3 should be easier to get running and getting PHP to work with it is fairly well documented.

Mac
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post by mikeq »

What file extension did you give to your file?
Rider
Forum Newbie
Posts: 9
Joined: Sun Oct 06, 2002 3:56 am
Contact:

Post by Rider »

.inc

But, that isn't the problem. It's because PHP and Apache aren't playing nicely like they should.

-Rider
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post by mikeq »

Okay, so you have told apache to interpret .inc as a PHP file?
Post Reply