LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   PHP execution from home directory (https://www.linuxquestions.org/questions/linux-software-2/php-execution-from-home-directory-119369/)

orinjus 11-24-2003 12:32 AM

PHP execution from home directory
 
I have just installed php and apache2 from source according to the instructions here, and I am trying to set it up so that I can have php scripts in my public_html directory. I have a test php script in the DocumentRoot that executes correctly when I visit it in my browser, so I know my php setup it working. I have the exact same script in my public_html directory, but when I visit it in my browser it pops up a save dialog. The script has the executable permission set, and here is the part of my httpd.conf dealing with home dirs:
Code:

<Directory /home/*/public_html>
    AllowOverride None
    Options ExecCGI SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>

I really am at a loss to figure out what I am doing wrong here. Can anyone help me out?

lynger 11-24-2003 03:21 AM

hi :)

when this happens:
* pops up a save dialog.

it shows that the apache is not working properly.. pls. verify if you configured httpd.conf properly. you could also post here your config files.

goodluck

orinjus 11-24-2003 05:54 PM

Yes, I figured as much, but I am trying to figure out what the issue is :) My full httpd.conf is huge, so I don't want to paste it all, but here are the parts dealing with modules and directories:
Code:

LoadModule php4_module        modules/libphp4.so

<Directory />
  Options FollowSymLinks
  AllowOverride None
</Directory>

<Directory "/usr/local/apache2/htdocs">
  Options Indexes FollowSymLinks
  AllowOverride None
  Order allow,deny
  Allow from all                                                                             
</Directory>

UserDir public_html

<Directory /home/*/public_html>
    AllowOverride None
    Options ExecCGI SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>

DirectoryIndex index.html index.php

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

My php compilation options:
Code:

'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql'
And as I said before, exact same script, works in documentroot, doesn't work in home dir.

DirtDart 11-25-2003 09:04 AM

orinjus - What browser are you using?

I am having the same problem; here's the specifics:

Linux (Mandrake 9.2) server, Windows (2000) client.

Using Firebird (0.7) or even IE (5.5 and 6.0), I get the same thing, it wants to save to disk, or wants to know what to use to open them.

With Mozilla 1.5, it opens them right up, so that tells me the config is OK on the web server.

Weird.

lynger 11-26-2003 06:28 PM

hi :)

i'm not quite sure about this.. but could you try this..

1.) you're using php4 lib.. so ( just maybe ) make your pages have extensions *.php4

2.) then add to your httpd.conf line saying directory index.

--DirectoryIndex index.html index.php index.php4

3.) and another in you addtype line:


---AddType application/x-httpd-php .php4

I admit i'm new to php but just a hunch.. i hop it could help..

good luck


All times are GMT -5. The time now is 11:18 PM.