I’ve created a custom CMS, and it works perfectly on a local server using MAMP, even if content is stored in a remote database. However, when I run it on my client’s host server, shit happens.
The problem is that the CMS can’t process texts which are longer than a few words. By instance, if the text is “lorem ipsum” it’ll work fine, but if the text is three paragraphs long, it will display an error submitting the post.
I’m assuming this is a php.ini issue, and we have already changed php.ini memory_limit from 16M to 128M. However, the issue persists.
So my question is: does anyone know of a good way of identifying what php.ini configurations cause trouble, other than changing them one by one?
Needless to say that if I run a phpinfo() on my local server and the host server a lot of the configurations are different…
Thank you for your time and help.
[EDIT]
This edit has been rewritten as an answer 😉
I decided to check the most common php.ini configurations that CMS like Drupal or WordPress usually demand. One of them has to do with
magic_quotes_gpc.I found that my local server had this
Onand the host server had itOff, so I tried if there was an issue with that, and… there was.I’m ashamed to say that, but the problem had to do with a bad practice on my side. I hadn’t escaped properly the data coming from the posts form. After escaping all the
$_POSTwithmysql_real_escape_string()everything worked fine.Lessons learned
I hope this will be useful to someone.