Results 1 to 9 of 9
For some reason, when I try to view php files on my linux box, they want to download instead of viewing them.
I configured apache for php as the manual ...
- 03-22-2010 #1Just Joined!
- Join Date
- Oct 2007
- Posts
- 12
PHP files want to download instead of viewing them
For some reason, when I try to view php files on my linux box, they want to download instead of viewing them.
I configured apache for php as the manual said but for some reason it doesn't want to parse the php.
On another post someone suggested that the http.conf file may need to be changed, that the line "AddModule mod_php4.c" was missing in the conf, however the AddModule and ClearModuleList directives no longer exist in the newer versions of Apache. These directives were used to ensure that modules could be enabled in the correct order. The new Apache 2.0 API allows modules to explicitly specify their ordering, eliminating the need for these directives.
So... what do I do now to fix this same issue?
- 03-22-2010 #2
How did you install php? Are you running Fedora or RHEL?
- 03-22-2010 #3Just Joined!
- Join Date
- Oct 2007
- Posts
- 12
It's Fedora Core and I installed it from source, - meaning that I downloaded the tar.gzip file, ran 'tar', 'make', 'make clean' and 'make install'.
Maybe I should just delete the whole directory structure and re-install as if new???
- 03-22-2010 #4
I tend to take the distro's package over installing from source when I can, since this has a tendency to come back and bite you in the bum later.
Not sure what you are doing with php4, its mostly php5 nowadays. When Red Hat type systems install it, it usually drops a php.conf in the conf.d of apache (aka httpd). Something like:
When compiling and installing from source, make sure its going to the appropriate modules directory, typically /usr/lib/httpd/modules. Otherwise try doing a locate to find out where it did drop it and tell it to load it from there.Code:LoadModule php5_module modules/libphp5.so AddHandler php5-script .php AddType text/html .php DirectoryIndex index.php
linux user # 503963
- 03-22-2010 #5Just Joined!
- Join Date
- Oct 2007
- Posts
- 12
OK, thanks. Now, however, I keep getting this error when I try to restart apache:
[root@hostname rc5.d]# apachectl start
httpd: Syntax error on line 234 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: undefined symbol: sqlite3ExprDelete
What does "sqlite3ExprDelete" have to do with any of this? What is it?
- 03-22-2010 #6
well you could either try to install sql lite, might be able to install it via yum. or do a make clean and compile php with --without-pdo-sqlite. not sure if you want to do that or not.
linux user # 503963
- 03-22-2010 #7Just Joined!
- Join Date
- Oct 2007
- Posts
- 12
We are making progress! I did a re-compile and now am seeing this error:
[root@localhost bin]# apachectl start
httpd: Syntax error on line 234 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: cannot restore segment prot after reloc: Permission denied
Ever seen this before?
- 03-23-2010 #8
try turning off selinux:
Code:setenforce permissive
linux user # 503963
- 03-23-2010 #9
Apparently that problem is caused by selinux and the fix is to run
Code:chcon -t texrel_shlib_t /usr/local/apache2/modules/*.so


Reply With Quote