Posts under PHP

PHP Fatal error: Class ‘DOMDocument’ not found in …

advertisement

phpTrying to migrate a symfony system to a new server. It show me “PHP Fatal error: Class ‘DOMDocument’ not found in…” when i click on some link. After some checking, the problem actually caused by a missing module – php xml module. Install the module will solve the problem 🙂

To solve “PHP Fatal error: Class ‘DOMDocument’ not found in”, follow the steps below:-

Continue reading PHP Fatal error: Class ‘DOMDocument’ not found in … »

How to remove newline character in PHP

advertisement

phpI need to remove newline character using PHP from user input, so the input will show in one line for my CSV file. I’ve tried to use nl2br and str_replace the br tag but it doesn’t work. At the end, i need to use regular expression to solve this.

To remove newline character in PHP, follow the steps below:-

Continue reading How to remove newline character in PHP »

How to downgrade to PHP 5.2 using MacPort

advertisement

phpI just reinstalled my PHP using MacPort and the PHP version is 5.3. I need to downgrade to PHP 5.2 as some of my application still not compatible with PHP 5.3. Had tried many ways but no luck. Luckily, one of my friend experienced this before and he pointed out the right way to downgrade to PHP 5.2 using macport to me. Thanks Paul!

To downgrade to PHP 5.2 using MacPort, follow the steps below:-

Continue reading How to downgrade to PHP 5.2 using MacPort »