Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 13 of 13
  1. #1
    Member
    Join Date
    Jan 2010
    Posts
    5

    Default PHP not working correctly after Easyapache

    After trying several profiles including basic and customised and previous working profile, Apache start and up and running ok, in command line I can do PHP -i and php -r and php -v fine no problem. I had to reset PHP+SUExec manually, but still no joy. when it comes to processing php files on the web it asks to download file. Any ideas?

  2. #2
    Member
    Join Date
    Jan 2005
    Location
    Earth
    Posts
    1,050

    Default

    create a .htaccess file under the account in question i.e. under the public_html directory and add the following line

    AddHandler application/x-httpd-php .php .php5

  3. #3
    Member
    Join Date
    Jan 2010
    Posts
    5

    Default

    PHP is now working had to allow for mime types to establish.

    I now have http:500 error looked in httpd logs cant see much in there

  4. #4
    Member
    Join Date
    Jan 2008
    Posts
    49

    Default

    try running
    Code:
    tail -f /usr/local/apache/logs/error_log
    then refresh the page getting the 500 error several times and post the errors you see from the error log here.

  5. #5
    Member
    Join Date
    Jan 2010
    Posts
    5

    Default

    Was't really coming up with anything, I did find in one of the php logs for the main site that extensions directory was't being found as it had changed since running easy apache.

    Then completely cleared the tmp dir as some of the session files were not writable.

    Did a full reboot, still no joy, so reinstalled via easyapache selecting some different php options.

    ran /usr/local/cpanel/bin/rebuild_phpconf 5 none cgi 1

    and all up and running now.

    Not sure what fixed it maybe clearing tmp and reinstall and rebuild php config from shell got it going.

    Need to do some more tests with php but up and runing for now.

  6. #6
    SGM
    SGM is offline
    Registered User
    Join Date
    Nov 2008
    Posts
    2

    Default Re: PHP not working correctly after Easyapache

    Today I also ran in a similar problem. It seems that the command line utility solved it. I used this command:
    Code:
    /usr/local/cpanel/bin/rebuild_phpconf 5 none suphp 1
    as I'm running PHP with suPHP.

    Hope this helps.

    P. S. Forgot to mention - keep in mind browsers like to cache things, so after i run the above command Firefox didn't send a new request to the server, but kept offering to download the file from the cache.
    Last edited by SGM; 02-12-2011 at 09:46 PM.

  7. #7
    Member
    Join Date
    Apr 2002
    Posts
    5

    Default Re: PHP not working correctly after Easyapache

    Hi there!!!

    I had similar issues (same symptoms); and I documented this for all of your reference... It took my whole day! Thanks for help from my Guru Engineer - SGM!

    When it was upgraded, it had issues; i was attending a class today and whole day worked on it (almost 8 hours) and finally fixed the problem.

    here is my feedback:
    a. upgraded easyapache via WHM with php 5.3.4 and apache 2.2; after recompile everything, the php failed
    b. had ffmpeg installed in php; removing that didnt fix the problem.
    c. recompiled manytimes; but no resolution.
    d. and php fixed using command line
    /usr/local/cpanel/bin/rebuild_phpconf 5 none suphp 1

    I tried to upgrade whm almost 10 times.

    when easyapache completes the process, it shows the final php-build-conf with the options 5 none none 1 ---- this time, it did not show, and somehow it was not taking affect.


    the very last part need to be configured ... but it was failing. using correct command line it was ok... using suphp. I used cpanel to ocnfigure suphp but it didnt takes affect. MORAL OF STORY: problem is with cpanel upgrade process ; and or easyapache process.... it is broken somewhere!

    following your method did not fix the problem as is... need to enable suphp via commad line (whm was not doing it! even when explicitly selected the options... at the completion of easyapache upgrade, it was not presenting the options...)
    Last edited by ghalman; 02-12-2011 at 11:41 PM.
    ---
    Looking for the best Control Panel.

  8. #8
    Member
    Join Date
    Feb 2011
    Posts
    46

    Default Re: PHP not working correctly after Easyapache

    Hello,

    I have never tried this command.

    /usr/local/cpanel/bin/rebuild_phpconf 5 none suphp 1

    What none denotes in this command?

  9. #9
    SGM
    SGM is offline
    Registered User
    Join Date
    Nov 2008
    Posts
    2

    Default Re: PHP not working correctly after Easyapache

    Quote Originally Posted by Cindu View Post
    Hello,

    I have never tried this command.

    /usr/local/cpanel/bin/rebuild_phpconf 5 none suphp 1

    What none denotes in this command?
    none denotes the php 4 handler. According to the command help:

    Code:
    Usage: /usr/local/cpanel/bin/rebuild_phpconf [--dryrun] [--no-restart] [--no-htaccess] [--current|--available] <Default PHP> <PHP4 Handler> <PHP5 Handler> <Suexec>
     --dryrun       : Only display the changes that would be made
     --no-restart   : Don't restart Apache after updating the php.conf link
     --no-htaccess  : Don't update user configurable PHP mime mapping.
     --current      : Show current settings
     --available    : Show available handlers and PHP SAPIs
     <Default PHP>  : Version of PHP to set as default handler for .php files
     <PHP# Handler> : Type of Apache module to use in serving PHP requests
     <Suexec>       : enabled, disabled, 1 or 0

  10. #10
    Member
    Join Date
    Jun 2007
    Posts
    128

    Default Re: PHP not working correctly after Easyapache

    Quote Originally Posted by madaboutlinux View Post
    create a .htaccess file under the account in question i.e. under the public_html directory and add the following line

    AddHandler application/x-httpd-php .php .php5
    Ok, after a EasyApache update, (and I have done this 3 times), some (not all) php files want to download instead of running.
    Adding this line fixed that issue for those sites that were having this problem.

    Question: Do I have to add this to every single users .htaccess file ?? Or is there a universal (single) file I can add this to that would handle this for all customers?

    Thank you.

  11. #11
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    de profundis
    Posts
    5,415
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: PHP not working correctly after Easyapache

    Are you using suPHP as the handler? If so, what does your /usr/local/apache/conf/php.conf file look like?

    Code:
    cat /usr/local/apache/conf/php.conf
    Next, what are the file extensions for the php pages that aren't loading? Are they ending in .php or something else? If only some of the PHP pages were trying to download and not all of them, then there has to be either a change in the extension being used or something on the account itself.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  12. #12
    Member This forum account has been confirmed by cPanel staff to represent a vendor. Radio_Head's Avatar
    Join Date
    Feb 2002
    Posts
    2,057

    Default Re: PHP not working correctly after Easyapache

    I had the same problem too after easypache.

    Executing
    # php -v
    I have seen segmentation fault error related to ioncube.

    To fix the issue I edited /usr/lib/php.ini and moved following 2 lines

    extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613"
    zend_extension="/usr/local/IonCube/ioncube_loader_lin_5.2.so"

    AFTER all zend lines .

    After this step , I executed
    # /usr/local/cpanel/bin/rebuild_phpconf 5 none suphp 1

    and all worked ok .

    Of course take in mind the SMG note

    P. S. Forgot to mention - keep in mind browsers like to cache things, so after i run the above command Firefox didn't send a new request to the server, but kept offering to download the file from the cache.
    Stop SPAM & VIRUS :: ASSP Deluxe for cPanel http://www.grscripts.com
    █ ASSP Deluxe is supported by Fritz Borgstedt,ASSP main developer.

  13. #13
    Member
    Join Date
    Jun 2007
    Posts
    128

    Default Re: PHP not working correctly after Easyapache

    Quote Originally Posted by cPanelTristan View Post
    Are you using suPHP as the handler? If so, what does your /usr/local/apache/conf/php.conf file look like?

    Code:
    cat /usr/local/apache/conf/php.conf
    Next, what are the file extensions for the php pages that aren't loading? Are they ending in .php or something else? If only some of the PHP pages were trying to download and not all of them, then there has to be either a change in the extension being used or something on the account itself.
    Tristan,

    Thanks for the reply. Yes, we are using suPHP (only with PHP 5, we took out PHP 4). All files have .php as the extension as well. Initially, it started with just one site, (all other sites were working just fine), I recompiled Apache/PHP using EasyApache (like I have done a hundred times in the past) and after that, all PHP sites were affected.

    This is what is currently in our php.conf file:

    Code:
    # This file was automatically generated by the Cpanel PHP Configuration system
    # If you wish to change the way PHP is being handled by Apache on your system,
    # use the /usr/local/cpanel/bin/rebuild_phpconf script or the WHM interface.
    #
    # Manual edits of this file will be lost when Apache is updated.
    
    
    # SuPHP configuration for PHP5
    LoadModule suphp_module modules/mod_suphp.so
    suPHP_Engine on
    AddHandler application/x-httpd-php5 .php
    AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
    <Directory />
        suPHP_AddHandler application/x-httpd-php5
    </Directory>
    
    # End of autogenerated PHP configuration.
    We added the

    Code:
    AddHandler application/x-httpd-php5 .php
    To globally fix this issue for all users who were having this issue.

    That fixed it again for all users, but why it happened in the first place is the real mystery.

    I've compared the php.conf file to other servers that are working fine and they look 100% identical with the exception of that line above that I added.

    Thanks,
    Peter

Similar Threads & Tags
Similar threads

  1. Replies: 15
    Last Post: 08-15-2011, 02:27 PM
  2. easyapache not so easy? PHP scripts not working
    By Final-Solution in forum cPanel and WHM Discussions
    Replies: 11
    Last Post: 07-07-2008, 12:04 PM
  3. Replies: 6
    Last Post: 09-19-2007, 11:05 AM
  4. One of my php is not working and not sure what to choose in easyapache
    By alilam in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 07-03-2003, 12:14 PM
  5. Addon not working correctly.
    By noodles in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-11-2003, 05:02 PM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube