Virtualmin (latest build)
os: latest ubuntu 20.04 LTS
php version 7.4 (default installation with virtualmin)
Hi jents
Yesterday I moved all my sites to the new server with
Most of the pages were Wordpress and they all work. Few of my other sites are hand coded and suddenly it was dumping all my code.
Further investigation the code was “commented out” and all code (incl. passwords) can be seen under source code of the website. see attached screenshot.
I have been looking until 4am and tried both on LAMP and LEMP. The php settings has been applied (so it does not download files but runs them, but the code itself is does not get executed)
Source code is NOT commented out in source but the server is doing that, and Wordpress sites runs just fine… can it be a php version?
I think I have covered it all.
… with Virtualmin’s import tools or by copying? Have you compared ownership and permissions between old and new servers?
Deprecated functions are a consideration if you were using an older PHP version before. In your code or php.ini file try enabling debugging errors and notices for more precise clues. But verify file permissions first.
ramin: thx for your suggestions. The premissions are correct since i use a plugin called duplicator, and if the premissions were wrong it will not be able to exstract the zip file that is uploaded with the installer script, wordpress is running on it like a champ. (files are chmod 644 and folders are chmod 755)
my code ran on php 7.2 no problems… i will enable debugging and see what is going on.
It’s weird but somewhere there’s an explanation. I’m drawing a blank though. I’m not sure you’re out of the woods yet but you’re definitely onto something. Normally you want logging off otherwise logs get heavy and slow things down.
Make sure error reporting is enabled with display_errors = On and then reveal all errors with error_reporting = E_ALL. Then gradually suppress errors that aren’t helping.
Bear in mind that if visitors are hitting your site you might want to install a landing page that prevents them from seeing a lot of PHP noise.
Btw, I should have said PHP error logging is what gets to be a nuisance, not all logging. It depends on how error reporting is set, and those logs should be set to a max size anyway.