Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8360723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:32:10+00:00 2026-06-09T11:32:10+00:00

UPDATE: SOLVED I’ve discovered the issue. Using the .libPaths() function, I was able to

  • 0

UPDATE: SOLVED
I’ve discovered the issue.

Using the .libPaths() function, I was able to determine that the default directory that the HH package installed into was not included in the library paths when running Rscript through PHP, even though it was appearing when R was executing the same code through the command prompt.

I’ve resolved the issue by include a separate call to .libPaths(‘new/file/path’); in my dynamically created syntax. When I do this, test <-require(‘HH’); test; returns TRUE;

Thanks to all who helped.

I’m in the process of creating a PHP script that will run some analyses in R. This analysis requires the hov.bf() function, which is a part of the HH package, but all R output (and presumably processes associated with R) stops from the line where the hov.bf() function is called. The same symptom occurs if I try loading the HH library via library(‘HH’);. What’s confusing me, the exact same R syntax code executes and outputs ALL print statements(base and HH functions) without error when run via the (Ubuntu) command prompt.

Overview of code:

PHP creates R syntax and writes to file Rsyntax.txt. Some of the following lines are located in the R syntax file:

dir = '/var/www/someDirectory/';
setwd(dir);
sink('record.lis', append=FALSE, split=TRUE);

print('hello-1');
test <- hov.bf(Values,Grouping);
print('hello-2');

q();

After syntax file is generated, PHP then runs:

exec("/usr/bin/Rscript /var/www/someDirectory/Rsyntax.txt --no-save", $output);

When run through PHP, the output file will contain all output created above the call to hov.bf(), but nothing seems to run after this call. That is, “hello-1” is present in the output file, but “hello-2” and all other output below the hov.bf() call is not written to the file. However, when I copy and paste the exact command from PHP’s exec() to Ubuntu’s command prompt, it runs all R syntax without issue. I have also tried setting the .Rprofile to load the HH package as a default when R is loaded, but this did not resolve the issue through PHP.

If anyone has any ideas, I would greatly appreciate them. I’ve run out of ideas for what it might be.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:32:11+00:00Added an answer on June 9, 2026 at 11:32 am

    I’ve discovered the issue.

    Using the .libPaths() function, I was able to determine that the default directory that the HH package installed into was not included in the library paths when running Rscript through PHP, even though it was appearing when R was executing the same code through the command prompt.

    I’ve resolved the issue by include a separate call to .libPaths('new/file/path'); in my dynamically created syntax. When I do this,

    test <-require('HH'); 
    test; 
    returns TRUE;
    

    Thanks to all who helped.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

UPDATE The issue is solved, all the code you can see works. Hello! I
Updated Problem solved, I have some design problem here. The directory looks like that:
UPDATE: SOLVED! For the broken pages I simply made an admin controller. That has
Update Solved the issue and there was an cycle retain. Original Question Profile showed
UPDATE: QUESTION SOLVED! I realized that the reason for this is due to 'hoisting.'
UPDATE: Solved. Thanks BusyMark! EDIT: This is revised based on the answer below from
UPDATE: SOLVED Hi all, i've got it, just save cookie to temp file, and
Update 7/17 SOLVED I've updated my code to the Solved version. Original Question I'm
UPDATE: First problem solved, second one described at the bottom of this post. UPDATE2:
Update II Problem Solved but Why? This has been the biggest headache ever. My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.