LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-30-2011, 11:35 PM   #1
jrecortel
Member
 
Registered: Sep 2008
Location: Philippines
Distribution: slackware, FreeBSD
Posts: 123

Rep: Reputation: 19
PHP files in Debian Squeeze


Hello. I installed apache2, php5, mysql-server and phpmyadmin in Debian Squeeze using Synaptic. After that, I create a link to userdir.conf and userdir.load to /etc/apache2/mods-enabled so that i can store and run my PHP files in /home/user/public_html. But when I tried to browse my files in a browser, a dialog box asking me whether to open or save the file appears. But if I try to open phpmyadmin, it correctly display the page. How can i configure it to display the PHP file which resides in public_html in my browser? Thanks in advance.
 
Old 05-31-2011, 01:26 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Are you pointing your web browser at the http server or directly at the file?

Eg
Code:
http://localhost/~user/somefile.php
Or
Code:
file:///home/user/public_html/somefile.php
If the former: Did you install libapache2-mod-php5?
If the later: You should not expect it to work since php is server side interpreted.

Evo2.
 
Old 05-31-2011, 07:22 AM   #3
jrecortel
Member
 
Registered: Sep 2008
Location: Philippines
Distribution: slackware, FreeBSD
Posts: 123

Original Poster
Rep: Reputation: 19
Thank evo2. Yes, libapache2-mod-php5 is installed in my system. I type in address bar this:
Code:
http://localhost/~user/info.php
The content of info.php is
Code:
<?php
phpinfo();
?>
but the browser only open a dialog box asking whether to open or save the file. Is there any configuration I need to perform so that it can display the PHP files in the public_html? Thanks in advance.
 
Old 05-31-2011, 08:14 AM   #4
jrecortel
Member
 
Registered: Sep 2008
Location: Philippines
Distribution: slackware, FreeBSD
Posts: 123

Original Poster
Rep: Reputation: 19
I put a # in the php_admin_value engine Off of /etc/apache2/mods-enabled/php5.conf like this:
Code:
<IfModule mod_userdir.c>
    <Directory /home/*/public_html>
     #   php_admin_value engine Off
    </Directory>
</IfModule>
and restart the apache and now it works. Is this the correct solution? Thanks in advance.
 
Old 05-31-2011, 07:20 PM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
Originally Posted by jrecortel View Post
I put a # in the php_admin_value engine Off of /etc/apache2/mods-enabled/php5.conf like this:
Code:
<IfModule mod_userdir.c>
    <Directory /home/*/public_html>
     #   php_admin_value engine Off
    </Directory>
</IfModule>
and restart the apache and now it works. Is this the correct solution?
It seems that php was explicitly disabled for users public_html directories. I think you could actually comment out that whole <IfModule> block.

Cheers,

Evo2.
 
Old 05-31-2011, 09:31 PM   #6
jrecortel
Member
 
Registered: Sep 2008
Location: Philippines
Distribution: slackware, FreeBSD
Posts: 123

Original Poster
Rep: Reputation: 19
Thanks evo2 for the reply. Is it the same as
Code:
php_admin_value engine On
as in commenting the entire block? What is their difference? thanks in advance.
 
Old 05-31-2011, 09:48 PM   #7
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
Originally Posted by jrecortel View Post
Is it the same as
Code:
php_admin_value engine On
as in commenting the entire block? What is their difference? thanks in advance.
Presumably, by default it is on so you shouldn't need to explicitly turn it on in your config file. For a definitive
answer you will need to read the documentation and check all your apache config files.

Evo2.
 
Old 06-01-2011, 03:24 AM   #8
jrecortel
Member
 
Registered: Sep 2008
Location: Philippines
Distribution: slackware, FreeBSD
Posts: 123

Original Poster
Rep: Reputation: 19
Thanks for the advice evo2. Will mark it now as solved.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian Squeeze and apache worker + php skoinga Debian 1 05-26-2011 04:54 PM
LXer: amon.so: Hijacking System Calls For Hardening PHP - Debian Lenny And Squeeze LXer Syndicated Linux News 0 04-11-2011 02:30 PM
LXer: Make Browsers Cache Static Files With mod_expire On Lighttpd (Debian Squeeze) LXer Syndicated Linux News 0 03-25-2011 10:11 PM
LXer: Make Browsers Cache Static Files With mod_expires On Apache2 (Debian Squeeze) LXer Syndicated Linux News 0 03-10-2011 01:30 PM
LXer: How To Upgrade Debian Lenny (Debian 5.0) To Squeeze (Debian 6.0) On Xen VPS LXer Syndicated Linux News 0 03-09-2011 05:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration