Find the answer to your Linux question:
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 ...
  1. #1
    HRT
    HRT is offline
    Just Joined!
    Join Date
    Oct 2007
    Posts
    12

    Exclamation 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?

  2. #2
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,344
    How did you install php? Are you running Fedora or RHEL?

  3. #3
    HRT
    HRT is offline
    Just Joined!
    Join Date
    Oct 2007
    Posts
    12

    Exclamation

    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???

  4. #4
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    616
    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:

    Code:
    LoadModule php5_module modules/libphp5.so
    AddHandler php5-script .php
    AddType text/html .php
    DirectoryIndex index.php
    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.
    linux user # 503963

  5. #5
    HRT
    HRT is offline
    Just Joined!
    Join Date
    Oct 2007
    Posts
    12

    Exclamation

    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?

  6. #6
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    616
    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

  7. #7
    HRT
    HRT is offline
    Just Joined!
    Join Date
    Oct 2007
    Posts
    12

    Exclamation

    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?

  8. #8
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    616
    try turning off selinux:
    Code:
    setenforce permissive
    linux user # 503963

  9. #9
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,344
    Apparently that problem is caused by selinux and the fix is to run
    Code:
    chcon -t texrel_shlib_t /usr/local/apache2/modules/*.so

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...