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

Latest version conflicting with another external script #560

Closed
sarangandk opened this issue Aug 30, 2015 · 9 comments
Closed

Latest version conflicting with another external script #560

sarangandk opened this issue Aug 30, 2015 · 9 comments

Comments

@sarangandk
Copy link

I have an external script which uploads Wordpress galleries from images in ftp server. Latest version of ZenCache is giving some problems that prevent my script not working anymore.

I'm willing to share my script with the developers, not in public.
Please tell me how to share it with you by email or private.

When I load my script, I get the following error message:

#4 [internal function]: WebSharks\ZenCache\Pro\AbsBaseAp->WebSharks\ZenCache\Pro\{closure}('/^\\/category\\/a...')
#5 /home/domain.tld/public_html/wp- in /home/domain.tld/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php on line 264

Fatal error: Uncaught exception 'Exception' with message 'Invalid argument; host token empty!' in /home/domain.tld/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php:264
Stack trace:
#0 [internal function]: WebSharks\ZenCache\Pro\AbsBaseAp->WebSharks\ZenCache\Pro\{closure}('/^\\/category\\/a...')
#1 /home/domain.tld/public_html/wp-content/plugins/zencache-pro/src/includes/classes/AbsBaseAp.php(55): call_user_func_array(Object(Closure), Array)
#2 /home/domain.tld/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(54): WebSharks\ZenCache\Pro\AbsBaseAp->__call('deleteFilesFrom...', Array)
#3 /home/domain.tld/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(54): WebSharks\ZenCache\Pro\Plugin->deleteFilesFromHostCacheDir('/^\\/category\\/a...')
#4 [internal function]: WebSharks\ZenCache\Pro\AbsBaseAp->WebSharks\ZenCache\Pro\{closure}('/^\\/category\\/a...')
#5 /home/domain.tld/public_html/wp- in /home/domain.tld/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php on line 264      
@raamdev
Copy link
Contributor

raamdev commented Aug 31, 2015

@sarangandk You can share privately by opening a ticket here: http://wsharks.com/1fRVz6b (link expires in 48 hours)

@sarangandk
Copy link
Author

I have uploaded the script.

Sarangan T.

On Mon, Aug 31, 2015 at 10:29 PM, Raam Dev [email protected] wrote:

@sarangandk https://github.com/sarangandk You can share privately by
opening a ticket here: http://wsharks.com/1fRVz6b (link expires in 48
hours)


Reply to this email directly or view it on GitHub
#560 (comment).

@raamdev
Copy link
Contributor

raamdev commented Sep 4, 2015

@sarangandk It looks like ZenCache is not finding your hostname in $_SERVER['HTTP_HOST'] when your script runs, which seems odd to me. Can you try adding echo $_SERVER['HTTP_HOST'] to your script (or otherwise the value of $_SERVER['HTTP_HOST'] while your script is running) to see if there's something odd being returned? It should contain the hostname for your site.\


Referencing internal ticket with script you submitted: https://websharks.zendesk.com/agent/tickets/8106

@sarangandk
Copy link
Author

Hello,
I just did that as you requested and echo $_SERVER['HTTP_HOST'] echo'ing my
domain correctly. The following error displaying only when I run the PHP
script via cron. When I load the script via browser like
http://domain/script.php it works fine.

PHP Fatal error: Uncaught exception 'Exception' with message 'Invalid

argument; host token empty!' in
/home/tamil.gallery/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php:264
Stack trace:
#0 [internal function]:
WebSharks\ZenCache\Pro\AbsBaseAp->WebSharks\ZenCache\Pro{closure}('/^/category/a...')
#1
/home/tamil.gallery/public_html/wp-content/plugins/zencache-pro/src/includes/classes/AbsBaseAp.php(55):
call_user_func_array(Object(Closure), Array)
#2
/home/tamil.gallery/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(54):
WebSharks\ZenCache\Pro\AbsBaseAp->__call('deleteFilesFrom...', Array)
#3
/home/tamil.gallery/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(54):
WebSharks\ZenCache\Pro\Plugin->deleteFilesFromHostCacheDir('/^/category/a...')
#4 [internal function]:
WebSharks\ZenCache\Pro\AbsBaseAp->WebSharks\ZenCache\Pro{closure}('/^/category/a...')
#5 /home/tamil.gallery/public_html/wp- in
/home/tamil.gallery/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php
on line 264

Fatal error: Uncaught exception 'Exception' with message 'Invalid
argument; host token empty!' in
/home/tamil.gallery/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php:264
Stack trace:
#0 [internal function]:
WebSharks\ZenCache\Pro\AbsBaseAp->WebSharks\ZenCache\Pro{closure}('/^/category/a...')
#1
/home/tamil.gallery/public_html/wp-content/plugins/zencache-pro/src/includes/classes/AbsBaseAp.php(55):
call_user_func_array(Object(Closure), Array)
#2
/home/tamil.gallery/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(54):
WebSharks\ZenCache\Pro\AbsBaseAp->__call('deleteFilesFrom...', Array)
#3
/home/tamil.gallery/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php(54):
WebSharks\ZenCache\Pro\Plugin->deleteFilesFromHostCacheDir('/^/category/a...')
#4 [internal function]:
WebSharks\ZenCache\Pro\AbsBaseAp->WebSharks\ZenCache\Pro{closure}('/^/category/a...')
#5 /home/tamil.gallery/public_html/wp- in
/home/tamil.gallery/public_html/wp-content/plugins/zencache-pro/src/includes/closures/Shared/CacheDirUtils.php
on line 264

Sarangan T.

On Fri, Sep 4, 2015 at 4:45 AM, Raam Dev [email protected] wrote:

@sarangandk https://github.com/sarangandk It looks like ZenCache is not
finding your hostname in $_SERVER['HTTP_HOST'] when your script runs,
which seems odd to me. Can you try adding echo $_SERVER['HTTP_HOST'] to
your script (or otherwise the value of $_SERVER['HTTP_HOST'] while your
script is running) to see if there's something odd being returned? It
should contain the hostname for your site.


Reply to this email directly or view it on GitHub
#560 (comment).

@jaswrks
Copy link

jaswrks commented Sep 4, 2015

The following error displaying only when I run the PHP
script via cron. When I load the script via browser like
http://domain/script.php it works fine.

So this is the problem. Running the script via CRON is a much different thing in terms of which environment variables are set. WordPress is not a command-line application, it is a web-based application. If you have a CRON job, use something like cURL to call the CRON job via http:// instead of as a command-line application. That way all of the expected environment variables will exist.

@sarangandk
Copy link
Author

Hmm, anyway my script worked without any problems until you released the
latest version of ZenCache.

Sarangan T.

On Sat, Sep 5, 2015 at 1:13 AM, JasWSInc [email protected] wrote:

The following error displaying only when I run the PHP
script via cron. When I load the script via browser like
http://domain/script.php it works fine.

So this is the problem. Running the script via CRON is a much different
thing in terms of which environment variables are set. WordPress is not a
command-line application, it is a web-based application. If you have a CRON
job, use something like Lynx to call the CRON job via http:// instead of
as a command-line application. That way all of the expected environment
variables will exist.


Reply to this email directly or view it on GitHub
#560 (comment).

@jaswrks
Copy link

jaswrks commented Sep 9, 2015

Hmm, anyway my script worked without any problems until you released the
latest version of ZenCache.

If you look at the configuration of your CRON job (perhaps configured in cPanel), see if there's an option to load the full URL instead of entering an absolute file path location. They may resolve the issue for you here as a short-term fix.

Related issue: #563

@sarangandk
Copy link
Author

Yes, but the reason for why I load the script using absolute file path is
because of calling from http will give some timeout problems. Anyway thanks
for your suggestion. I have downgraded ZenCache to older version as a
short-term fix.

Sarangan T.

On Wed, Sep 9, 2015 at 5:24 AM, JasWSInc [email protected] wrote:

Hmm, anyway my script worked without any problems until you released the
latest version of ZenCache.

If you look at the configuration of your CRON job (perhaps configured in
cPanel), see if there's an option to load the full URL instead of entering
an absolute file path location. They may resolve the issue for you here as
a short-term fix.

Related issue: #563 #563


Reply to this email directly or view it on GitHub
#560 (comment).

@raamdev raamdev added this to the Next Release (Pro) milestone Oct 7, 2015
@raamdev
Copy link
Contributor

raamdev commented Oct 29, 2015

@sarangandk This issue should be resolved in the next Pro release as part of the work that was completed here: #563 (comment)

If after the next update you're still having issues, please let us know and I'll reopen this issue.

@raamdev raamdev closed this as completed Oct 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants