Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for importing on shared hosting servers #54

Open
HorstGassner opened this issue Dec 19, 2019 · 13 comments
Open

Better support for importing on shared hosting servers #54

HorstGassner opened this issue Dec 19, 2019 · 13 comments

Comments

@HorstGassner
Copy link

Hi!

If I open the settings I get the following error:

Fehler
[GoogleAnalyticsImporter] Required Executables (php)
[GoogleAnalyticsImporter] Required Executables (nohup)

I'm using the latest version of Matomo and the PlugIn (1.2.1)

@diosmosis
Copy link
Member

For now, the CLI php and nohup executables have to be available on your server for the importer to run. These errors are reporting that Matomo cannot find them. Are they in actuality available?

@HorstGassner
Copy link
Author

Thank you for your fast response!

Maybe a dumb question - but where could I find these files?
What I can find is CliPhp.php in the Matomo /core/CliMulti/ directory.

I've installed Matomo in it's own subdomain. These should not be a problem, should it?

@diosmosis
Copy link
Member

diosmosis commented Dec 20, 2019

Those (php & nohup) are actually executables that would be found on your server. Your host (if you have one) may have disabled their use in some way. The plugin currently uses them to do the importing in the background. It's something you'd have to talk to your host about, or perhaps there is some setting that needs to be set in cpanel, otherwise importing won't currently be possible.

That said, I've recently thought of a way around that since there are many users on shared hosting that seem interested in importing their GA data. Unfortunately I won't have time to work on it for a week or two, but it will be available in version 1.3.0.

EDIT: Just in case I didn't answer your question, they would be in one of your server's bin folders. If you can run commands on the server via ssh access, you could run which php or which nohup to find them.

@HorstGassner
Copy link
Author

Importing data is one of the things that are very important to many of my colleagues (I am a blogger and the EU GDPR is a painful problem for many of us). Most of us want to get rid of GA, but we don't want to lose historical data. And yes - many of us use shared hosting (because it's cheaper).

My current provider package does not allow SSH access. An upgrade would not be that expensive, but at the moment I have no chance of using SSH. Maybe I'll upgrade.

It would be great if the plugin would work without SSH in the future and I think there are some people out there who would love that :-).

@diosmosis
Copy link
Member

@HorstGassner I wouldn't purchase ssh, having ssh access wouldn't make the plugin work for you, it would just allow you to check/debug some things. I might ask the host specifically "Is it possible to make the 'php' and 'nohup' executables available on my server?" and "How long will a script when run via shell_exec("php ...") be allowed to run before it is terminated (if it is terminated)?". These are the main problems that occur with shared hosting (the executables being missing or the import process being cut off by the host because it takes a long time), and if the host can fix them then you won't have to pay at all.

However, it's pretty likely the host won't be able to make any changes, but as I said, I have solution to the problem and it will be available in a week or two.

@diosmosis diosmosis changed the title Error in System check Better support for importing on shared hosting servers Jan 14, 2020
@seybsen
Copy link

seybsen commented Sep 10, 2020

A config option to set paths to php and nohup would be nice for hosts which have multiple php versions installed (e.g. Plesk)

@errotu
Copy link

errotu commented Oct 17, 2020

First of all: Thanks a lot for your great work! Unfortunately, I'm also affected by the limitations of my hoster. Are there any news on the implementation of an importing method without nohup?

@diosmosis
Copy link
Member

@errotu unfortunately it's not a high priority at the moment, matomo 4 is the main focus.

Note: you can import from the CLI directly using the googleanalyticsimporter:import-reports command (the user docs have more info on this and some possibilities for bypassing shared hosting limitations). However you may run into other limits/blocks placed by the hoster.

@diosmosis
Copy link
Member

In case anyone wants to avoid using nohup, it's possible w/ the latest version to use the GoogleAnalyticsImporter.useNohup DI setting. This would require adding the setting to your matomo/config/config.php file (creating it if it's not there):

<?php

return [
    'GoogleAnalyticsImporter.useNohup' => false,
];

@dathwa
Copy link

dathwa commented Oct 26, 2021

Can someone please explain where exactly i may disable nohup. Matomo V4.5.
There is no config/config.php file.
There is config.ini.php
tried GoogleAnalyticsImporter['useNohup] = false but it breaks site.
Thanks.

In case anyone wants to avoid using nohup, it's possible w/ the latest version to use the GoogleAnalyticsImporter.useNohup DI setting. This would require adding the setting to your matomo/config/config.php file (creating it if it's not there):

<?php

return [
    'GoogleAnalyticsImporter.useNohup' => false,
];

@diosmosis
Copy link
Member

@dathwa config/config.php is a file you create the first time you need it. Matomo doesn't break if it's not there.

@bastians
Copy link

@diosmosis My hoster does not allow nohup for PHP, therefore I would like to use the setting. I created the config.php file and added the code you posted. Should the hint in the system check of Matomo be gone or does it still show up?

@diosmosis
Copy link
Member

@bastians it should still show up at present. The diagnostic code doesn't take into account the dependency injection override in config/config.php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants