How to setup auto_prepend_file with safe mode and open basedir restriction

Submitted by Anonymous (not verified) on Fri, 03/13/2009 - 19:59

You want to setup an auto_prepend_file or auto_append_file on a shared webhosting server. It is enaugh to change setting in php.ini file usually. But it does not work under safe_mode with open basedir restriction and suexec. To run it without turning off your security settings:

  • edit php.ini file : pico -w /usr/local/lib/php.ini
  • set safe_mode_include_dir = /path/to/your/safe_mode_inc_dir
  • add "/path/to/your/safe_mode_inc_dir" to include_path
  • set auto_prepend_file = /path/to/your/safe_mode_inc_dir/your_auto_prepend.php
  • restart your webserver : httpd restart

How to override php mail function to catch abuse / spammer

Submitted by Anonymous (not verified) on Fri, 03/13/2009 - 14:24

I think somebody sending spam mail from my account with using php-scripts. I can not watch all php files because there are too many. And when I look in exim mail_log, I see just mail header. The log file is too big because all incoming and outgoing mail is logged. I just need a override possibility for php mail function to log all details including mail-body and attachment to determine if it is a smap mail. I just tried to install php pecl apd but no luck.

pecl install apd

Let your visitors run Drupal cron for you

Submitted by Anonymous (not verified) on Fri, 03/06/2009 - 15:10

Sometimes (or mostly on shared hosts) wo dont have ssh/shell acces to server to configure crontab. In this case we need to run crons manually or register for a paid cron-service or find an other solution. For my solution I need just one visitor a day to request a hidden img-tag. And its working; at least once a day Drupal runs cron.php.

  • Create a block called something like "run cron manually"
  • Activate your block; move to footer region etc
  • Put following code and save as PHP-Filter (input format)

Code for "run cron manually with a footer block"

CMS experiences with Drupal, Typo3, Joomla and Plone needed

Submitted by Anonymous (not verified) on Fri, 03/06/2009 - 00:04

Please add your experinces with these popular CMS/Frameworks. I am just a beginner and have some experiences with Joomla 1.5 and Drupal 6 series. I find Joomla's all-inclusive installation and Drupals flexibility awesome. I have just installed Typoe3 to test but it seems to take long time with many clicks to create and edit content. Therefore I didnt try it much.

Unable to send e-mail. Please contact the site admin, if the problem persists (Drupal Error)

Submitted by Anonymous (not verified) on Thu, 03/05/2009 - 01:29

If you get this error:

  • install Drupal SMTP Module: http://drupal.org/project/smtp
  • download & extract phpmailer to modules/smtp/phpmailer : http://phpmailer.sourceforge.net/
  • dont forget to rename "modules/smtp/phpMailer_vx.." to "modules/smtp/phpmailer"
  • Turn SMTP on : admin/settings/smtp
  • double check your auth-settings

How to compress/backup just ascii-text files with linux tar

Submitted by Anonymous (not verified) on Wed, 03/04/2009 - 16:38

I have a website with some large files like binary audio/mp3, video and xml. I want to automate a backup, which includes just text files like .html, .php, .inc, .tpl etc and ignores large files even if they are ascii. For example a ssh/shell command with putty?

I want to include .php, .txt, .inc, .html files and ignore files bigger than 100mb.