update.php doesn't understand environment variables

Development-related discussion, including bundled plugins
amit
Bear Rating Trainee
Bear Rating Trainee
Posts: 20
Joined: 12 Jan 2012, 13:13

update.php doesn't understand environment variables

Postby amit » 17 Feb 2012, 16:31

Hello,

I've deployed tt-rss on OpenShift PaaS, and the recommended way to point to the DB is to use the environment varialbe OPENSHIFT_DB_HOST. My config.php has the following:

define('DB_HOST', $_ENV['$OPENSHIFT_DB_HOST']);

which works fine for the viewing of the feeds.

However, the update.php script, which is run via cron, doesn't pick up those env variables, and ends up using incorrect values for all such relative paths. I tried a few things but couldn't figure out why the main app could use the env vars but the update script couldn't. Any ideas?

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: update.php doesn't understand environment variables

Postby fox » 17 Feb 2012, 17:16

Maybe you should ask the hosting provider why the variable is not available when running under cron?

amit
Bear Rating Trainee
Bear Rating Trainee
Posts: 20
Joined: 12 Jan 2012, 13:13

Re: update.php doesn't understand environment variables

Postby amit » 20 Feb 2012, 15:18

The variables are available under cron (in fact, the update script couldn't have run w/o it, since even the location of the tt-rss installation is accessed via env. vars).

I also tried running the update.php script from the command prompt. It errors out in the same way -- essentially sanity_check.php reporting bad permissions on all the directories -- despite 'env' showing all the env vars set properly.

Thanks for your time!


Return to “Development”

Who is online

Users browsing this forum: No registered users and 2 guests