Category: php

vtiger: Sorry! Attempt to access restricted file. After moving it

11:50 AM by admin

Filed under php

Last modified 11:51 AM

You get the message “Sorry! Attempt to access restricted file.” from vtiger after you have moved it to another path or even another server?

PHP Fatal error: Class ‘tslib_cObj’ not found

03:54 PM by Christian Koch

Filed under php, t3 extension development

Last modified 03:54 PM

when you get the error "PHP Fatal error: Class 'tslib_cObj' not found" go to the file displayed in your error log and replace tslib_cObj with \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer

PHP Fatal error: Class ‘t3lib_div’ not found

02:56 PM by Christian Koch

Filed under php, t3 extension development

Last modified 02:57 PM

when you get the error "PHP Fatal error:  Class 't3lib_div' not found" go to the file displayed in your error log and replace t3lib_div with \TYPO3\CMS\Core\Utility\GeneralUtility

PHP Fatal error: Class ‘tslib_pibase’ not found

02:48 PM by Christian Koch

Filed under php, t3 extension development

Last modified 02:52 PM

When you receive this error in TYPO3 6 or 7 go to the error file and replace class whatever extends tslib_pibase, the tslib_pibase with \TYPO3\CMS\Frontend\Plugin\AbstractPlugin

PHP email subject encoding UTF-8

11:38 AM by Christian Koch

Filed under php

Last modified 11:44 AM

To fix the encoding of email subject that you send with PHP wrap your subject in '=?UTF-8?B?' / "?=" and also use the PHP function base64_encode() to encode your original subject. Check out the code sample:

Eclipse PHP – Set maxiumum line width

02:07 PM by Christian Koch

Filed under Eclipse, php

Last modified 02:11 PM

Open preferences window and go to PHP -> Code Style -> Formatter and there you click on "Edit..." of the current selected profile: Now go to the tab called "Line Wrapping" and there set the field "Maximum line width" to your wished line width: After click on the tab called "Comments" and there set the field "Maximum line width for comments" also to 120: Click ...

PHP Get first and last date of month

09:57 AM by Christian Koch

Filed under php

Last modified 09:57 AM

Learn how to get the first and last day of a month.

PHP SimpleXML – create XML

05:08 PM by Christian Koch

Filed under php

Last modified 05:08 PM

Here’s the snippet to create some xml with PHP’s SimpleXML Lib: