Skip to main content

EasyApache stuffs up PHP on subdomains only (browser wants to download)

Comments

6 comments

  • RoseHosting
    Hello Starcraftmazter your PHP files are not being processed by the PHP, you should check your Apache Handler for PHP you can test it also with info.php file just to display the PHP version
    0
  • Starcraftmazter
    @RoseHosting - yes I understand it's not being processed by PHP... and I already said the handler is not there for the subdomain vhost - my question is why would this be the case for subdomain(s) only ? I can't change the httpd.conf myself, cPanel generates and regenerates it - the question is, what would be leading it to do this behavior.
    0
  • cPanelLauren
    Hello @Starcraftmazter
    • I want to point out that you wouldn't ever need to "recompile" anything using easyapache 4.
      • Everything is RPM-based and compiled prior to your adding the feature.
      • Even updates to EA4 packages are done automatically with yum so no matter how long you left it, everything should continue to update.
    • As far as *why* the sites are downloading rather than displaying, it's typically something added to the .htaccess
      • Usually an invalid [COLOR=rgb(243, 121, 52)]AddType or [COLOR=rgb(243, 121, 52)]AddHandler.
      • One way to avoid this is to make any and all changes to the php configuration through the MultiPHP Manager within cPanel.
    • Under no circumstances should the WHM>>Service Configuration>>Apache Configuration or through the use of
    0
  • Starcraftmazter
    Hey @cPanelLauren It cannot be anything to do with the .htaccess, because exactly the same code runs fine when accessed without the subdomain, as I linked to in the OP. It has to be the vhost setting. Thanks Max
    0
  • cPanelLauren
    Well, depending on the location of the documentroot of that subdomain that line of thought could potentially be incorrect. If the documentroot is outside of the public_html an .htacess file within the public_html would not affect it. Furthermore, depending on the handler/configuration, an .htacess isn't always read recursively but if you think it HAS to be a VirtualHost setting, and knowing you can't make changes directly to the apache configuration that would affect this, but you could potentially add the AddHandler or AddType (or related directives) in an include. That'd be the next step to check: Individual virtual host
    • With SSL - /etc/apache2/conf.d/userdata/ssl/2_4/user/domain/includename.conf
    • Without SSL - /etc/apache2/conf.d/userdata/std/2_4/user/domain/includename.conf
    0
  • Starcraftmazter
    The directory for the subdomain is inside public_html indeed. Weirdly, without me doing anything it works now, but css/js seems to be broken, even though they all seem to load, through that subdomain.
    0

Please sign in to leave a comment.