[SOLVED] Strange thing: Saving options of one website breaks the other...

Discussion in 'Technical' started by josecash, Mar 17, 2016.

  1. josecash

    josecash New Member

    Hello there,

    I'm facing such a weird problem...

    I'm moving to ISPConfig, I have it installed on a Debian 8 Jessie in its last version with apache2, bind, jailkit, vlogger, postfix, fail2ban...

    Till now I've just uploaded 2 websites and create 2 limit plans with 2 different clients. Both of the websites are based on symfony2 framework, same version, and I just cant run both at the same time, if I change anything on Sites > Website, the other web stop working throwing an error 500, let's say for example, I go to menu Sites and select web1, change whatever under Web Domain options, no matter whitch tab, and press Save, after a minute web1 starts working and web2 stops, same thing if I do it with web2. Isn't it weird?

    Both websites are in mod_php, no suExec (changing to suexec makes no diference). The error thrown to the logs in the failing website is a PHP Fatal error: Cannot redeclare class AppKernel in app/AppKernel.php on line 6, whitch make no sense...

    I have checked both virtualhost and I think its allright...

    Any help will be highly appreciated.

    Thanks for reading.
  2. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    Have you enabled any kind of opcode caching and played with their performance tweaks?
    If so, does the issue disappear if you disable opcode caching temporarily?
    And please move on, mod_php is kind of obsolete - try FPM mode. Oh and reenable suexec.
    josecash likes this.
  3. josecash

    josecash New Member

    Thanks so much!!!!
    XCache was the problem, I have uninstalled it, I think there is no cache system for php 5.6, is it?
    I followed all your other advices as well, suExec enabled and changed to PHP-FMP, everything is working fine right now.
    Thanks again, you are the best, I never would have come to that conclusion by myself.
  4. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    The reason could be it strips include paths or does something else weird stuff.
    Since PHP 5.5 there's an opcode cache already included, if you enabled that together with xcache could be another cause for issues.

    Check your php.ini
    ; if you want zend opcode caching go near
    ; Dynamic Extensions ;
    ; section and add
    ; if you enabled zend_extension=opcache.so adjust at least the following settings
    opcache.use_cwd=1 ; make sure it's enabled if you host more than one site using this php version
    josecash likes this.
  5. josecash

    josecash New Member

    Perfect, opcache enabled.
    But I'm back to MOD_PHP, with PHP-FMP headers redirection is not working, something with fast-cgi I've read and I have understood fast-cgi is slow, so I think for me its ok mod php.

    Thanks, I really appreciate your help.
  6. ztk.me

    ztk.me Well-Known Member HowtoForge Supporter

    depends :)
    Having mod_php you have multiple opcode caches which can't communicate to each other resulting in multiple caches and needs of caching files.
    Having external PHP-FPM you have one opcode cache.

    FastCGI is not CGI ( which indeed is slow since it spawns one interpreter per request ) and FastCGI in ISPConfig is actually FCGI which is not FastCGI ... sounds crazy? Well yeah it is :) PHP-FPM is using real FastCGI - which is kind of an old implementation but is fast and stable.

    Besides, mod_php has some issues if it comes down to file permissions, files you read/write are owned by www-data, in every web - and if you want PHP to write to files uploaded using FTP, you need to make them writeable for every user on the system ( basically ).

    I don't know what header redirection issue you faced by using PHP-FPM, it is working absolutely fine...

    Just a few thoughts, I don't want to talk you into changing your setup or create new issues - just saying :)

    Besides, if you skip mod_php you can go using apache2-mpm-event or mpm-worker which also will gain you some increase in performance and resource usage. You might setup a test system to validate if it's true for your use case however.
    Edit: whops, mod_suphp (obsolete anyway ) mod_ruby ( already taken out of modern distributions ) and maybe mod_python ( not sure if it works well with the other mpms ) needs to be taken out, too - I don't know many ppl using them anyway...
    josecash likes this.
  7. josecash

    josecash New Member

    Thanks for clarifying all mods, I really needed...
    Yeah, you are right (as usually), permissions are a pain with mod php and you are the master so finally I found out a solution, that was a permissions issue with tmp folder, I don't know how symfony2 redirect function manage headers but simply with
    chown -R webuser /path/to/client/website/tmp/
    The problem has gone!!!
    Thanks to you I have my system working properly and efficiently. Thanks so much again.
    Last edited: Mar 17, 2016
    ztk.me likes this.

Share This Page