Archive.php stopped working after 2.1.0 Upgrade


#1

Anyone having problems with auto archiving with this upgrade? Worked fine on previous version, having upgraded I now have to reloy on browser updates as I get errors.

PHP’s error log shows “Directive ‘safe_mode’ is deprecated in PHP 5.3 and greater in Unknown on line 0” and I get this output if I run archive.php in a browser window


INFO [2014-03-14 11:14:38] [27c18] ---------------------------
INFO [2014-03-14 11:14:38] [27c18] INIT
INFO [2014-03-14 11:14:38] [27c18] Querying Piwik API at: http://analytics.x-shops.co.uk/misc/cron/../../index.php
INFO [2014-03-14 11:14:38] [27c18] Running Piwik 2.1.0 as Super User: admin
INFO [2014-03-14 11:14:46] [27c18] ERROR: The Piwik URL http://analytics.x-shops.co.uk/misc/cron/../../index.php does not seem to be pointing to a Piwik server. Response was 'PHP Warning:  Directive 'safe_mode' is deprecated in PHP 5.3 and greater in Unknown on line 0PHP Warning:  shell_exec(): Cannot execute using backquotes in Safe Mode in /var/www/vhosts/x-shops.co.uk/subdomains/analytics/httpdocs/core/CliMulti/Process.php on line 165PHP Warning:  file_put_contents(): SAFE MODE Restriction in effect.  The script whose uid is 10003 is not allowed to access /var/www/vhosts/x-shops.co.uk/subdomains/analytics/httpdocs/tmp/climulti/f33cbb8b664b9f8a4a8eeacf189bb5b1675c3f7847cc7d8da22976fe6d84462a10ef4de047daa9050c1514b5edd99a59c20c0.pid owned by uid 502 in /var/www/vhosts/x-shops.co.uk/subdomains/analytics/httpdocs/core/CliMulti/Process.php on line 140PHP Warning:  file_put_contents(/var/www/vhosts/x-shops.co.uk/subdomains/analytics/httpdocs/tmp/climulti/f33cbb8b664b9f8a4a8eeacf189bb5b1675c3f7847cc7d8da22976fe6d84462a10ef4de047daa9050c1514b5edd99a59c20c0.pid): failed to open stream: Permission denied in /var/www/vhosts/x-shops.co.uk/subdomains/analytics/httpdocs/core/CliMulti/Process.php on line 140'.

I have lifted memory to 2GB just in case but no difference. My php is 5.3.3. I can update but not without pain as this box has several e-commerce sites running different software versions.

Anyone else in the same boat?


#2

yap, I have just received another problem with 2.1:

PHP Warning: filemtime(): stat failed for /var/www/owncloud/piwik/tmp/climulti/f66a83f07d653a4245d12b0a911cd4e35e85289d24fe333ee9b5ea870eb6579846d2885c1819d4c05a6509e685c3cc6c90410.output in /var/www/piwik/core/CliMulti.php on line 177
PHP Warning: unlink(/var/www/owncloud/piwik/tmp/climulti/f66a83f07d653a4245d12b0a911cd4e35e85289d24fe333ee9b5ea870eb6579846d2885c1819d4c05a6509e685c3cc6c90410.output): No such file or directory in /var/www/piwik/core/CliMulti.php on line 18


#3

sorry… missed last character…

PHP Warning: filemtime(): stat failed for /var/www/owncloud/piwik/tmp/climulti/f66a83f07d653a4245d12b0a911cd4e35e85289d24fe333ee9b5ea870eb6579846d2885c1819d4c05a6509e685c3cc6c90410.output in /var/www/owncloud/piwik/core/CliMulti.php on line 177
PHP Warning: unlink(/var/www/owncloud/piwik/tmp/climulti/f66a83f07d653a4245d12b0a911cd4e35e85289d24fe333ee9b5ea870eb6579846d2885c1819d4c05a6509e685c3cc6c90410.output): No such file or directory in /var/www/owncloud/piwik/core/CliMulti.php on line 180


(Peterbo) #4

x-shops, please try to disable safe_mode in PHP ini for this vhost. Safe_mode is deprecated in PHP 5.3 and throws this warning in the API request which is crashing the Archiver.


#5

I have PHP 5.3.3-7+squeeze19 and safe_mode disabled …


(Peterbo) #6

Povezi, the problem of the thread creator and yours are completely unrelated. Since I don’t know yet the answer to your problem, my given answer should solve the thread creator’s problem.


#7

ok, thnx… but both are related to upgrade to 2.1.0 :frowning:


#8

Peter (Boehlke) :
I have tried safe mode set on and off with stopping and starting (as opposed a service restart) Apache and exactly the same result. Running phpinfo confirms safe mode settings (from Plesk).


(Peterbo) #9

The “deprecated” warning does not depend on whether the setting is “on” or “off”. Completely remove the safe_mode setting from your php.ini. From all php.inis (cgi, cli, fpm, etc.), and all vhost php.inis if existent.


#10

The good news is that I can now run archive.php. However in order to do this I have had to remove the line from the global php.ini and change the Plesk settings for other subscriptions for some legacy stuff which expects a setting deprecated or not.


INFO [2014-03-19 15:00:26] [1ad6c] ---------------------------
INFO [2014-03-19 15:00:26] [1ad6c] INIT
INFO [2014-03-19 15:00:26] [1ad6c] Querying Piwik API at: http://analytics.x-shops.co.uk/misc/cron/../../index.php
INFO [2014-03-19 15:00:26] [1ad6c] Running Piwik 2.1.0 as Super User: admin
INFO [2014-03-19 15:00:26] [1ad6c] ---------------------------
INFO [2014-03-19 15:00:26] [1ad6c] NOTES
INFO [2014-03-19 15:00:26] [1ad6c] - If you execute this script at least once per hour (or more often) in a crontab, you may disable 'Browser trigger archiving' in Piwik UI > Settings > General Settings. 
INFO [2014-03-19 15:00:26] [1ad6c]   See the doc at: http://piwik.org/docs/setup-auto-archiving/
INFO [2014-03-19 15:00:26] [1ad6c] - Reports for today will be processed at most every 1800 seconds. You can change this value in Piwik UI > Settings > General Settings.
INFO [2014-03-19 15:00:26] [1ad6c] - Reports for the current week/month/year will be refreshed at most every 3600 seconds.
INFO [2014-03-19 15:00:26] [1ad6c] - Archiving was last executed without error 12 days 22 hours ago
INFO [2014-03-19 15:00:27] [1ad6c] - Will process 11 websites with new visits since 12 days 22 hours , IDs: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
INFO [2014-03-19 15:00:27] [1ad6c] ---------------------------
INFO [2014-03-19 15:00:27] [1ad6c] START
INFO [2014-03-19 15:00:28] [1ad6c] Archived website id = 1, period = day, Time elapsed: 1.120s
INFO [2014-03-19 15:00:29] [1ad6c] Archived website id = 1, period = week, 345 visits, Time elapsed: 0.804s
INFO [2014-03-19 15:00:30] [1ad6c] Archived website id = 1, period = month, 345 visits, Time elapsed: 1.003s
INFO [2014-03-19 15:00:32] [1ad6c] Archived website id = 1, period = year, 345 visits, Time elapsed: 2.440s
INFO [2014-03-19 15:00:32] [1ad6c] Archived website id = 1, today = 6 visits, 4 API requests, Time elapsed: 5.368s [1/11 done]

As the control panel updates it can update the global php.ini so I will have to wait and see. In the long term, unless there is some other way to fix this then it looks as though I will have to run a local LAMP box and put the subdomain on that. Shame because the earlier version just worked…

Actually, I could try to downgrade but I sure that with the DB changes I would lose existing data. To be honest next time I will run an update in a sandbox rather trusting the one click update.


(Peterbo) #11

This problem is completely unrelated to Piwik. There was a feature added in Piwik 2.1 which uses the command file_put_contents, therefore the minimum requirements have been raised to PHP version 5.3. If the user uses a legacy php.ini which raises Warnings at runtime, it’s not the software’s fault.


#12

I appreciate your comments. However, my setup will be quite common. Especially as Plesk is quite a popular control panel. To be honest, although the higher PHP requirement is a valid requirement, every other PHP application on all my dedicated boxes have no complaints with PHP settings.

However, thanks for your time and case closed.