HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=25)
-   -   Wordpress scheduled operations (http://www.howtoforge.com/forums/showthread.php?t=54665)

Skyflash 27th October 2011 09:49

Wordpress scheduled operations
 
(sorry for my bad english... i'll try explain the problem at my best...)

I have a trouble with any WP installation i do in ISPConfig. I've tried on thw different ISPConfig, one Ubuntu 11.10 based and other CentOS 5.5 based, following the Perfect Server documents.

I'm not a coder, but i think i understood WP don't use any cron job for schedule post publishing and other scheduled functions like a scheduled db backup via many plugins. Wordpress use a special function, called wp_schedule_event like this:
Quote:

Schedules a hook which will be executed by the WordPress actions core on a specific interval, specified by you. The action will trigger when someone visits your WordPress site, if the scheduled time has passed.
I've done many tests, but the result was the same: every envinronment i tested, every website wp-based, no scheduled actions is working.

I've used as user many other panels in the past, and i can say that in cPanel and Plesk the problem doesn't exists.

Someone can help me, pls?

till 27th October 2011 09:58

Quote:

I've used as user many other panels in the past, and i can say that in cPanel and Plesk the problem doesn't exists.
I use a lot of wordpress installs on my servers and I can say you that I never had this problem on any ispconfig server. So this problem is not related to the use of ispconfig.

Which PHP mode have you used for the website? CMS systems like wordpress require php-fcgi and suexec must be switched on in the site settings. Beside that, make sure that the files and folders in the web directory are owned by the web user and client group of this website.

Skyflash 27th October 2011 10:01

Quote:

Originally Posted by till (Post 266052)
I use a lot of wordpress installs on my servers and I can say you that I never had this problem on any ispconfig server. So this problem is not related to the use of ispconfig.

Bad news for me, because i'm having the trouble on both installs :(

Quote:

Which PHP mode have you used for the website? CMS systems like wordpress require php-fcgi and suexec must be switched on in the site settings. Beside that, make sure that the files and folders in the web directory are owned by the web user and client group of this website.
I'm using Suexec and SuPhp

I think the files ownership is ok:

Code:

root@server01:/var/www/clients/client1/web1/web# ll
total 280
drwx--x--- 7 web1 client1  4096 2011-10-25 12:30 ./
drwxr-x--x 6 web1 client1  4096 2011-10-27 00:30 ../
drwxr-xr-x 2 web1 client1  4096 2011-10-25 12:15 error/
-rw-r--r-- 1 web1 client1  397 2011-10-25 12:25 index.php
-rw-r--r-- 1 web1 client1  402 2011-10-25 12:25 LEGGIMI.txt
-rw-r--r-- 1 web1 client1 16572 2011-10-25 12:25 license.txt
-rw-r--r-- 1 web1 client1 24732 2011-10-25 12:25 licenza.html
-rw-r--r-- 1 web1 client1  8858 2011-10-25 12:25 readme.html
drwxr-xr-x 2 root root    4096 2011-10-26 00:30 stats/
-rw-r--r-- 1 web1 client1  4343 2011-10-25 12:25 wp-activate.php
drwxr-xr-x 9 web1 client1  4096 2011-10-25 12:25 wp-admin/
-rw-r--r-- 1 web1 client1 40243 2011-10-25 12:25 wp-app.php
-rw-r--r-- 1 web1 client1  226 2011-10-25 12:25 wp-atom.php
-rw-r--r-- 1 web1 client1  274 2011-10-25 12:25 wp-blog-header.php
-rw-r--r-- 1 web1 client1  3931 2011-10-25 12:25 wp-comments-post.php
-rw-r--r-- 1 web1 client1  244 2011-10-25 12:25 wp-commentsrss2.php
-rw-r--r-- 1 web1 client1  3926 2011-10-25 12:27 wp-config.php
-rw-r--r-- 1 web1 client1  3639 2011-10-25 12:25 wp-config-sample.php
drwxr-xr-x 8 web1 client1  4096 2011-10-25 13:36 wp-content/
-rw-r--r-- 1 web1 client1  1255 2011-10-25 12:25 wp-cron.php
-rw-r--r-- 1 web1 client1  246 2011-10-25 12:25 wp-feed.php
drwxr-xr-x 8 web1 client1  4096 2011-10-25 12:26 wp-includes/
-rw-r--r-- 1 web1 client1  1997 2011-10-25 12:25 wp-links-opml.php
-rw-r--r-- 1 web1 client1  2570 2011-10-25 12:25 wp-load.php
-rw-r--r-- 1 web1 client1 27601 2011-10-25 12:25 wp-login.php
-rw-r--r-- 1 web1 client1  7774 2011-10-25 12:25 wp-mail.php
-rw-r--r-- 1 web1 client1  494 2011-10-25 12:25 wp-pass.php
-rw-r--r-- 1 web1 client1  224 2011-10-25 12:25 wp-rdf.php
-rw-r--r-- 1 web1 client1  334 2011-10-25 12:25 wp-register.php
-rw-r--r-- 1 web1 client1  226 2011-10-25 12:25 wp-rss2.php
-rw-r--r-- 1 web1 client1  224 2011-10-25 12:25 wp-rss.php
-rw-r--r-- 1 web1 client1  9839 2011-10-25 12:25 wp-settings.php
-rw-r--r-- 1 web1 client1 18646 2011-10-25 12:25 wp-signup.php
-rw-r--r-- 1 web1 client1  3702 2011-10-25 12:25 wp-trackback.php
-rw-r--r-- 1 web1 client1  3266 2011-10-25 12:25 xmlrpc.php


till 27th October 2011 10:02

The ownerships are ok. Please switch from suphp to fastcgi.

Skyflash 27th October 2011 10:10

Quote:

Please switch from suphp to fastcgi.
Same result :(

http://dl.dropbox.com/u/1174908/ispconfig_site.jpg

http://dl.dropbox.com/u/1174908/wp-i...g-schedule.jpg

till 27th October 2011 10:19

1) Have you waited long enough? A switch in the config takes at least 1 minute.
2) Are there enough pageviews on the website in the meantime, as the cron gets only executed in wordpress if there is a pageview.
3) Do you use any caching plugins in wordpress? As plugins like w3totalcache and other plugins that use a .htaccess redirect to temporary created html files can prevent that the wordpress cron work.

Skyflash 27th October 2011 10:23

Quote:

1) Have you waited long enough? A switch in the config takes at least 1 minute.
Yes. About 10 minutes after the switch. Tried a second time some minutes ago

Quote:

2) Are there enough pageviews on the website in the meantime, as the cron gets only executed in wordpress if there is a pageview.
In the test installation, i refresh myself the page. In my personal blog i have about 5-600 visits per day

Quote:

3) Do you use any caching plugins in wordpress? As plugins like w3totalcache and other plugins that use a .htaccess redirect to temporary created html files can prevent that the wordpress cron work.
No, no caching plugin. The test installation is a clean WP 3.2.1

Is there something similar to a fgci or suphp log?

till 27th October 2011 10:30

Everything is logged to the apache access and error log, you find them in the log directory of the website.

Skyflash 27th October 2011 10:35

The error.log seems ok:
Code:

[Thu Oct 27 10:14:30 2011] [error] [client 93.63.146.178] File does not exist: /var/www/skyflashtest.biz/web/favicon.ico
[Thu Oct 27 10:14:30 2011] [error] [client 93.63.146.178] File does not exist: /var/www/skyflashtest.biz/web/favicon.ico
[Thu Oct 27 10:14:38 2011] [error] [client 93.63.146.178] File does not exist: /var/www/skyflashtest.biz/web/favicon.ico
[Thu Oct 27 10:14:40 2011] [error] [client 93.63.146.178] File does not exist: /var/www/skyflashtest.biz/web/favicon.ico
[Thu Oct 27 10:15:50 2011] [error] [client 93.63.146.178] File does not exist: /var/www/skyflashtest.biz/web/favicon.ico
[Thu Oct 27 10:16:39 2011] [error] [client 93.63.146.178] File does not exist: /var/www/skyflashtest.biz/web/favicon.ico
[Thu Oct 27 10:16:41 2011] [error] [client 93.63.146.178] File does not exist: /var/www/skyflashtest.biz/web/favicon.ico
[Thu Oct 27 10:19:12 2011] [error] [client 93.63.146.178] File does not exist: /var/www/skyflashtest.biz/web/favicon.ico
[Thu Oct 27 10:19:15 2011] [error] [client 93.63.146.178] File does not exist: /var/www/skyflashtest.biz/web/favicon.ico

access.log
Here i edited and scheduled the post:
Code:

93.63.146.178 - - [27/Oct/2011:10:30:31 +0200] "POST /wp-admin/post.php HTTP/1.1" 302 20 "http://skyflashtest.biz/wp-admin/post.php?post=5&action=edit" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
93.63.146.178 - - [27/Oct/2011:10:30:31 +0200] "GET /wp-admin/post.php?post=5&action=edit&message=1 HTTP/1.1" 200 19881 "http://skyflashtest.biz/wp-admin/post.php?post=5&action=edit" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
93.63.146.178 - - [27/Oct/2011:10:30:32 +0200] "GET /wp-admin/admin-ajax.php?action=oembed-cache&post=5 HTTP/1.1" 200 21 "http://skyflashtest.biz/wp-admin/post.php?post=5&action=edit&message=1" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"

93.63.146.178 - - [27/Oct/2011:10:30:33 +0200] "GET /favicon.ico HTTP/1.1" 404 809 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
93.63.146.178 - - [27/Oct/2011:10:30:36 +0200] "GET / HTTP/1.1" 200 2984 "http://skyflashtest.biz/wp-admin/post.php?post=5&action=edit&message=1" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
93.63.146.178 - - [27/Oct/2011:10:30:37 +0200] "GET /favicon.ico HTTP/1.1" 404 809 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"

and now is the time for publishing. I refresh the page:
Code:

93.63.146.178 - - [27/Oct/2011:10:30:32 +0200] "GET /wp-admin/admin-ajax.php?action=oembed-cache&post=5 HTTP/1.1" 200 21 "http://skyflashtest.biz/wp-admin/post.php?post=5&action=edit&message=1" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
93.63.146.178 - - [27/Oct/2011:10:30:33 +0200] "GET /favicon.ico HTTP/1.1" 404 809 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
93.63.146.178 - - [27/Oct/2011:10:30:36 +0200] "GET / HTTP/1.1" 200 2984 "http://skyflashtest.biz/wp-admin/post.php?post=5&action=edit&message=1" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
93.63.146.178 - - [27/Oct/2011:10:30:37 +0200] "GET /favicon.ico HTTP/1.1" 404 809 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
93.63.146.178 - - [27/Oct/2011:10:32:06 +0200] "GET / HTTP/1.1" 200 2983 "http://skyflashtest.biz/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
93.63.146.178 - - [27/Oct/2011:10:32:06 +0200] "GET /favicon.ico HTTP/1.1" 404 809 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
93.63.146.178 - - [27/Oct/2011:10:32:09 +0200] "GET / HTTP/1.1" 200 2982 "http://skyflashtest.biz/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"
93.63.146.178 - - [27/Oct/2011:10:32:10 +0200] "GET /favicon.ico HTTP/1.1" 404 809 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1"

I can't see anything wrong :(

till 27th October 2011 10:49

Please check that this value is not set in wp-config.php or that its set to false:

define('DISABLE_WP_CRON', true);

If its set to true, the internal cron in wordpress is disabled.

another problem can be the max php memory size or max execution time. You can try to increase them in the cgi php.ini file and then restart apache.


All times are GMT +2. The time now is 16:56.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.