LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   PHP unable to read .php files (https://www.linuxquestions.org/questions/linux-software-2/php-unable-to-read-php-files-93439/)

tuka 09-16-2003 12:08 PM

PHP unable to read .php files
 
Hi all,

I am having some trouble configuring my httpd.conf file to understand .php file extensions.

Two refrences I am using suggest 2 methods of which I have tried without result. For both I need to insert this in the httpd.conf file:

Method 1:
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
</Files>

Method 2:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

The resul I get whenever I try to load up phpinfo.php from localhost is:
You have chosen to download a file of type :
application/x-httpd-php from httpd://localhost/
What should mozilla do with this file ?



How do I solve this ?

The file is in /htdoc - the apache document root and I am using apache 2.0.17 I did not compile with loadable module support.

Thanks for any help on this...

Tuka

WiZaC 09-16-2003 12:11 PM

Do you have PHP installed?

Booster 09-16-2003 04:16 PM

tuka,

Maybe try tring "XBitHack" on in httpdcof, as follows:

<Directory />
Options FollowSymLinks
Options +Includes
XBitHack on
AllowOverride None
</Directory>

Then make the php file executable (ie:chmod 755 blah.php), worked for me. ;

Booster

tuka 09-16-2003 05:53 PM

Thanks guys,

I have been reviewing my installation of PHP and I think I did not install it right....I think that is my issue it was not installed right in the first place. Sorry there was no other way to test it except for a test.php file...

I am now trying to install a static module...still working at it.. will need some time to check a few things... I tried a dynamic DSO loadable module. But I cant compile it. I get the following (down below) as I was trying to compile a php loadable module for apache 2.0

I have installed and apxs too (although I do not know how to verify the version - would anyone know ?) My Apache 2.0 has DSO support. Basically I followed the steps given in the PHP INSTALL file for DSO install.

My config is thus:
./configure --prefix=/usr/local/php --with-xml --with-curl=/usr/bin --enable-shared-pdflib --enable-track-vars --enable-magic-quotes --with-gd=shared,/usr/lib --enable-safe-mode --with-exec-dir=/usr/bin --enable-ftp --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs

which runs OK however my make hicups with this error (last 4 lines):

-lz -lssl -lcrypto -lcrypt -lcrypt -o libphp4.la
ext/ctype/ctype.lo: file not recognized: File truncated
collect2: ld returned 1 exit status
make: *** [libphp4.la] Error 1

Any suggestion of what is wrong?

I will keep working on the static version unless I replies soon.
If you have your compile scripts and step in making your apache compile into PHP version that would be helpful....

Thansk again,

wright_pm 10-12-2003 06:12 PM

I have similar problem..have you found a solution please?

macewan 10-12-2003 06:20 PM

try installing "apt-get" for redhat and then "synaptic" which is a front end for apt-get.

you can then install apache (httpd), mysql and php all at the same time. just did so the other day. words fine.

littis 10-12-2003 06:40 PM

For a dynamic php module you need to have mod_so running with apache. It does not install with the module by default (I believe...been awhile) so when installing apache type ./configure --enable-module=so. You should then be able to follow the php install for dynamic and everything should go smoothly.







Scott


All times are GMT -5. The time now is 03:07 PM.