You say PHP 5, let’s assume it’s at least 5.5…
Ok, so maybe you could try an advanced debugging technique (one I’m going to write a blog post about, pretty soon).
Install something called auditctl. This will let you monitor specific folders and see exactly what SuiteCRM is trying to read/write, and whether it’s succeding or not.
sudo apt-get install auditd audispd-plugins
If you need to find your config file, to edit the log location, try this
find / -name auditd.conf 2>/dev/null
nano /etc/audit/auditd.conf
Now you need to add rules saying what you want to monitor. I suggest something like this (adapt to your paths, of course):
auditctl -a exit,always -F dir=/var/www/html/custom -F perm=rwa
auditctl -a exit,always -F dir=/var/www/html/modules -F perm=rwa
To list currently active rules:
auditctl -l
Now you can tail your log at the moment when you’re accessing the screens, or when you’re changing something in studio, or when you’re doing a Rebuild, to understand what’s going on:
cat /var/log/audit/audit.log | grep Line_Items.php
tail -f /var/log/audit/audit.log | grep -i 'custom/modules/AOS_Products_Quotes'
tail -f /var/log/audit/audit.log | grep -i 'Invoices\|Products\|Quotes'
That third example is an “OR”, it will match any of those words.
To delete ALL rules, when you’re finished, so that performance isn’t hurt in the future:
auditctl -D
With this I believe you can see “under the hood” what SuiteCRM is trying to load, including directories it is searching, before deciding to load a file. You can also detect if the problem is caused by insufficient permissions. This is a great way to get a grip on what’s wrong with some file you’re trying to customize.