SyntaxHighlighter

Showing posts with label plesk. Show all posts
Showing posts with label plesk. Show all posts

Friday, 15 June 2012

Process Different File Types with PHP in Plesk

So after having got PHP to process different files types in IIS7, the Plesk version of the site and using the .htaccess was giving me some grief. I came across this article on the parallels forum and got it work  by using a slightly modified version of the working example given.

AddHandler php-script .js


I needed PHP to process JavaScript files.

Thursday, 31 May 2012

Plesk - Checking the Mail Log

Do you need to check the mail logs on a Plesk server? Then here's an article on how to: http://www.hosting.com/support/plesk/check-the-mail-log-on-plesk-server

You can get access to it here:
/usr/local/psa/var/log/maillog

Tuesday, 22 May 2012

Installing libmcrypt / mcrypt Module on Plesk

Had a major ball ache today getting the mcrypt module working on a plesk hosted VPS. This article was a god send!!


A lot less hair was lost :)

The crux of it is the that from the shell do the following:

> yum install libmcrypt-devel
If 32 bit do:
> yum install php-mcrypt
If 64 bit do:
> yum install php-mcrypt.x86_64

Friday, 9 March 2012

How To Call PHP From a Cron in Plesk

Like a lot of people I needed to run a PHP script from a cron (crontab) via the Plesk server admin tool. Simply putting the path to the file (from root) does not run it. The way to do this is by calling the php processor with some parameters. So do the following:

php -q /var/www/vhosts/mywebsite.com/httpdocs/cron/my-file.php

Obviously use the path that relates to your file.

This seems to work for a lot of people, but as my script had includes in it I was getting failure to open stream errors when it was called. So to get round this, I changed the directory prior to the call. So it now looks like this:

cd /var/www/vhosts/ mywebsite.com /httpdocs/cron; php -q  my-file .php

Hey presto, it all works a treat now!



You may need to set permissions on the script to be executed. By default, the task will email the output of the script to you (click the Settings option on the Scheduled Tasks page to change the address - see image below). This can be turned off by adding 2>&1 to the end of the command. making the it look like this:

cd /var/www/vhosts/ mywebsite.com /httpdocs/cron; php -q  my-file .php /dev/null 2>&1

Credit to http://daipratt.co.uk/crontab-plesk-php/ and http://stackoverflow.com/questions/3140675/php-cron-job-including-file-not-working for helping to work this mess out ;)

Labels

.net (7) ajax (1) android (7) apache (1) asp.net (3) asus (2) blogger (2) blogspot (3) c# (16) compact framework (2) cron (1) css (1) data (1) data recovery (2) dns (1) eclipse (1) encryption (1) excel (1) font (1) ftp (1) gmail (5) google (4) gopro (1) html (1) iis (3) internet explorer IE (1) iphone (1) javascript (3) kinect (1) linux (1) macro (1) mail (9) mercurial (1) microsoft (3) microsoft office (3) monitoring (1) mootools (1) ms access (1) mssql (13) mysql (2) open source (1) openvpn (1) pear (2) permissions (1) php (12) plesk (4) proxy (1) qr codes (1) rant (4) reflection (3) regex (1) replication (1) reporting services (5) security (2) signalr (1) sql (11) sqlce (1) sqlexpress (1) ssis (1) ssl (1) stuff (1) svn (2) syntax (1) tablet (2) telnet (3) tools (1) twitter (1) unix (3) vb script (3) vb.net (9) vba (1) visual studio (2) vpc (2) vpn (1) windows (4) woff (1) xbox 360 (1)