logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: Apache 2.2.3 + PHP5.1.6 mod loaded, PHP doesn't work
Author
davidlt



Joined: 12 Oct 2006
Posts: 11

PostPosted: Sat 14 Oct '06 19:43    Post subject: Apache 2.2.3 + PHP5.1.6 mod loaded, PHP doesn't work Reply with quote

Code:
C:\Apache2\bin>httpd -t -D DUMP_MODULE
Loaded Modules:
 core_module (static)
 win32_module (static)
 mpm_winnt_module (static)
 http_module (static)
 so_module (static)
 actions_module (shared)
 alias_module (shared)
 asis_module (shared)
 auth_basic_module (shared)
 authn_default_module (shared)
 authn_file_module (shared)
 authz_default_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 dir_module (shared)
 env_module (shared)
 imagemap_module (shared)
 include_module (shared)
 isapi_module (shared)
 log_config_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 setenvif_module (shared)
 userdir_module (shared)
 php5_module (shared)
Syntax OK

C:\Apache2\bin>


As you can see PHP module is loaded, all files comes from this website. My PHP is in C:\PHP.

The problem is that it doesn't execute PHP script, I am getting blank screen and when I look at source code in IE, where I should see HTML code, I see my PHP code. Any ideas?..

Back to top
CanUuRead



Joined: 18 Sep 2006
Posts: 38

PostPosted: Sun 15 Oct '06 3:52    Post subject: Reply with quote

What is the NAME of the file WE are viewing?

is it:

1. something.html
or
2. something.php

From what I see of your source, it looks like you named the file something.html. It should have a PHP extension like something.php.
Back to top
cefilos



Joined: 14 Oct 2006
Posts: 2

PostPosted: Sun 15 Oct '06 8:17    Post subject: Reply with quote

maybe you need something like

<IfModule dir_module>
DirectoryIndex index.php index.html index.htm
</IfModule>

<IfModule mod_php5.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php-source .phps
</IfModule>

or something like this to handle file type
Back to top
davidlt



Joined: 12 Oct 2006
Posts: 11

PostPosted: Sun 15 Oct '06 8:26    Post subject: Reply with quote

The file ends with .PHP

some parts fro my configuration:
<IfModule dir_module>
DirectoryIndex index.html index.htm index.php
</IfModule>

LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
# my php.ini is in this directory
PHPIniDir "c:/php"
Back to top
CanUuRead



Joined: 18 Sep 2006
Posts: 38

PostPosted: Sun 15 Oct '06 9:03    Post subject: Reply with quote

Ok...that clears up some stuff and begs for more questions.

Can you get results from a phpinfo PHP page?

Something like:

<?php
phpinfo ();
?>

...saved to something like phpinfo.php.

Idea Do you have an index.html with similiar mark-up with what is displayed in the above image?
My thinking here is there might be a similiar page named index.html or index.htm, and that you have the INDEX parameter in the Options directive for the folder set (since the above image shows an address of http://127.0.0.1/ with NO file being specified). I state this because the last URL of your DirectoryIndex directive shows that the INDEX.PHP will be served last due to the order given. From the Apache manual:
Quote:
>DirectoryIndex directive sets the list of resources to look for, when the client requests an index of the directory by specifying a / at the end of the directory name. Local-url is the (%-encoded) URL of a document on the server relative to the requested directory; it is usually the name of a file in the directory. Several URLs may be given, in which case the server will return the first one that it finds. If none of the resources exist and the Indexes option is set, the server will generate its own listing of the directory.


Put another way, YOUR DirectoryIndex statement will first check to see if INDEX.HTML exists, if so it will be served, if not then it will look for INDEX.HTM, then finally INDEX.PHP. If you want the PHP file to be served first then change you DirectoryIndex statement such that INDEX.PHP is first. Other than that you can specify the page as such http://127.0.0.1/index.php.
Back to top
davidlt



Joined: 12 Oct 2006
Posts: 11

PostPosted: Sun 15 Oct '06 13:52    Post subject: Reply with quote

Don't worry, I thought about this firstly and checked. The only file is index.php. If I write phpinfo(); I still will get blank screen and inside the source I will see my PHP code. Any more ideas?.. I think this is very interesting thing...
Back to top
CanUuRead



Joined: 18 Sep 2006
Posts: 38

PostPosted: Sun 15 Oct '06 17:17    Post subject: Reply with quote

Yeah, troubleshooting time?

Go to PHP.INI and temporarily set the following directives:

error_reporting = E_ALL

display_errors = On

log_errors = On

error_log = "C:/php/error.log"

E_ALL is most likely set, but check anyway, Display_Errors has the errors show up in your browser, Log_Errors is so that you will have a record, Error_Log sets the filename for the logfile so that you can open the file and view your error(s) (if file does not exists it will be created). Belt and Suspenders approach to catching errors.

After you reconfigure PHP make sure to either restart Apache OR stop then start Apache. Try your script again - what error(s) are being displayed? if any...
Back to top
davidlt



Joined: 12 Oct 2006
Posts: 11

PostPosted: Sun 15 Oct '06 18:00    Post subject: Reply with quote

Nice... Nothing, where are no errors, I am still getting the same, the files with errors wasn't created.

So I have nice problem, but as I can see module is really loaded... So why it doesn't execute then script?.. Downloaded EasyPHP 1.8 it worked perfect, but it is using PHP 4 and Apache 1.3.

But still I need answer... What cloud cause this problem?.. Or I should try to set up everything again, maybe eve try Apache 2.0?..
Back to top
davidlt



Joined: 12 Oct 2006
Posts: 11

PostPosted: Mon 16 Oct '06 15:22    Post subject: Reply with quote

Using original Apache files I couldn't even to set up PHP, even using DLL files from this site. I will try 2.0...
Back to top
davidlt



Joined: 12 Oct 2006
Posts: 11

PostPosted: Mon 16 Oct '06 17:36    Post subject: Reply with quote

Apache 2.0.59 + PHP 5.1.6 worked perfect, but I am still waiting for more solutions on 2.2.3...
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Mon 16 Oct '06 18:04    Post subject: Reply with quote

There are tons of posts in this forum about Apache 2.2 and PHP 5.x , maybe you can do a search and maybe you find some clues.

Most common cause of a blank page is that you have to set in php.ini : short_open_tag = On
Back to top
CanUuRead



Joined: 18 Sep 2006
Posts: 38

PostPosted: Mon 16 Oct '06 19:16    Post subject: Reply with quote

I'm not sure what you have going on since I cannot see everything on your system. It definitely sounds wierd though. No errors being thrown and no PHP execution...it's a little baffling. My best suggestion is follow the tutorial at the end of this post. It worked for me, and many other people. Don't leave any steps or details undone:

http://www.apachelounge.com/viewtopic.php?t=570
Back to top
davidlt



Joined: 12 Oct 2006
Posts: 11

PostPosted: Mon 16 Oct '06 21:13    Post subject: Reply with quote

I was doing everything step by step using that manual...
Back to top
CanUuRead



Joined: 18 Sep 2006
Posts: 38

PostPosted: Mon 16 Oct '06 23:11    Post subject: Reply with quote

Again, I would follow the tutorial in this post:

http://www.apachelounge.com/viewtopic.php?t=570

That's all I have...Hope the above helps.
Back to top
diesmo



Joined: 23 Oct 2006
Posts: 1

PostPosted: Mon 23 Oct '06 17:07    Post subject: Solved : PHP5.1.5 and apache 2.2.x Reply with quote

Hello,

I also had some problems using PHP 5.1.6 and Apache 2.2.3 on windows xp (my server would not start when enabling php as a module).

I advice you to use php 5.2 (take the latest snapshot for windows):
http://snaps.php.net/

there is a special dll in the package : php5apache2_2.dll beside the "old" php5apache2.dll.

You have to copy the php.ini-dist into php.ini in the PHP root directory.

Then you just have to configure a "httpd-php5.2.conf" and include it in the main apache httpd.conf :

# Load the module : use 2_2 DLL !
LoadModule php5_module "C:/Work/PHP/PHP5.2/php5apache2_2.dll"

# Add type
AddType application/x-httpd-php .php .php3 .php4 .php5

# configure the path to php.ini
PHPIniDir "C:/Work/PHP/PHP5.2"


Hope this helps.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Tue 24 Oct '06 10:40    Post subject: Reply with quote

Be aware that the module from 5.20 it is not build against php 5.1.6 and php 5.2.0 is still in development. To be safe use the one from here.

Steffen
Back to top


Reply to topic   Topic: Apache 2.2.3 + PHP5.1.6 mod loaded, PHP doesn't work View previous topic :: View next topic
Post new topic   Forum Index -> Other Software