Mombu the Php Forum

Go Back   Mombu the Php Forum > Php > Can not run PHP pages in Apache
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 25th October 10:41
keith
External User
 
Posts: 1
Default Can not run PHP pages in Apache



First time poster, so please bear with me...

I have installed Apache 1.3 and PHP 5.2.4. I am now trying to install Zen
Cart. When accessing the Zen Cart setup, the PHP files are not read. I
simply get a directory listing of files instead of execution of the
index.php. Seems I have missed something in the config files. When I run
php -v, everything seems to be fine with PHP, I just do not run PHP files.

Any help is greatly appreciated.
--
View this message in context: http://www.nabble.com/Can-not-run-PH...html#a13611132
Sent from the PHP - General mailing list archive at Nabble.com.
  Reply With Quote


 


2 25th October 10:42
parasane
External User
 
Posts: 1
Default Can not run PHP pages in Apache



That sounds like your DirectoryIndex directive needs to be
updated. Check your httpd.conf file and make sure it looks [something] like this:
<IfModule mod_dir.c>
DirectoryIndex index.html index.wml index.cgi index.shtml
index.jsp index.js index.jp index.php4 index.php3 index.php
index.phtml index.htm default.htm default.html home.htm
</IfModule>

Also be sure to check that you have these lines:
AddHandler application/x-httpd-php .php .php4 .php3 .phtml
AddHandler application/x-httpd-php-source .phps
AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps

Once you've added those lines, just restart Apache.

Keep in mind (you, too, archive readers!) that this is httpd
1.3.x-specific, and the syntax won't work on 2.x.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.
  Reply With Quote
3 26th October 00:25
keith
External User
 
Posts: 1
Default Can not run PHP pages in Apache


Thanks. And this did work. Or at least I am able to access php pages.
Given your comment about 1.3 vs. 2.2, I upgraded to 2.2. And I now have a
different issue. When accessing a PHP page the Apache HTTP Server process
crashes or I get a memory error. Any ideas?

--
View this message in context: http://www.nabble.com/Can-not-run-PH...html#a13616858
Sent from the PHP - General mailing list archive at Nabble.com.
  Reply With Quote
4 26th October 00:25
parasane
External User
 
Posts: 1
Default Can not run PHP pages in Apache


Did you recompile the module for Apache 2 and the apxs2 module?

In general, on a *nix-like system (i.e. - "non-Windows"), you
can't swap a module like PHP from one major version of Apache to
another. While a lot will work, most won't, and there can be some
serious repercussions, least of all being a segfault.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.
  Reply With Quote
Reply


Thread Tools
Display Modes




666