Title: Error message
Last modified: August 11, 2017

---

# Error message

 *  Resolved [ojuwig](https://wordpress.org/support/users/ojuwig/)
 * (@ojuwig)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/error-message-173-2/)
 * Hi,
 * I installed the plugin and used wpterm-check.php. It succeded. But when I run
   wpterm, I always get the error meessage “WPTerm: unknown error. Are you allowed
   to run PHP program execution functions?”
 * What can I do?
 * Best regards
 * Oliver

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [bruandet](https://wordpress.org/support/users/bruandet/)
 * (@bruandet)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/error-message-173-2/#post-9402721)
 * Hi,
 * This error is displayed when the data returned (via AJAX) by the command is empty.
   
   Did you try to select another PHP function for command execution in the “Settings”
   tab?
 *  [oliverjuwig](https://wordpress.org/support/users/oliverjuwig/)
 * (@oliverjuwig)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/error-message-173-2/#post-9408887)
 * Sorry, for my late reply. I was banned from the forum, since I posted links to
   my page. Didn’t know that and I always posted in conjunction with a support question
   or review. Anyway, regarding your question: I used any method, which is available.
   The error message is always the same for the shell command “ls”.
    -  This reply was modified 8 years, 10 months ago by [oliverjuwig](https://wordpress.org/support/users/oliverjuwig/).
 *  Plugin Author [bruandet](https://wordpress.org/support/users/bruandet/)
 * (@bruandet)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/error-message-173-2/#post-9410289)
 * You can try to debug it:
 * 1. Go to the “settings” tab, select “system” for the PHP function and save the
   settings.
 * 2. Open “wpterm.php” and [locate this line](https://plugins.trac.wordpress.org/browser/wpterm/tags/1.1.2/wpterm.php#L984):
 *     ```
       // Run the command:
       list( $res, $ret_var ) = @run_command( $command, trim( $_POST['exec'] ) );
       ```
   
 * Right below, add this code:
 *     ```
       @file_put_contents( '/full/path/to/debug.txt', "-\$res = {$res}\n=========\n-\$ret_var = {$ret_var}\n" );
       ```
   
 * 3. Replace `/full/path/to/debug.txt` with the full path to the debug log you 
   want to create (it must be writable).
 * 4. Go back to the terminal and enter the `uname` shell command.
 * 5. Check the `debug.txt` log and paste its content here.
 * 6. After your test, remove the line you added to the “wpterm.php” file.
 *  [oliverjuwig](https://wordpress.org/support/users/oliverjuwig/)
 * (@oliverjuwig)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/error-message-173-2/#post-9410530)
 * Thanks for your support. Here’s the output for the “uname” command:
 * -$res = SunOS
    [-{–}-]
 * =========
    -$ret_var = 0
 *  Plugin Author [bruandet](https://wordpress.org/support/users/bruandet/)
 * (@bruandet)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/error-message-173-2/#post-9410710)
 * I can see your problem: your server does not have the `$PWD` environment variable
   defined. WPTerm uses it to retrieve the current working directory.
    It is possible
   to use the `pwd` command instead.
 * 1. Search and remove this line of code:
 *     ```
       $command = sprintf( "ABSPATH=%s;cd %s;%s 2>&1;echo [-{-%s-}-]", $abs, $cwd, $cmd, '$PWD' );
       ```
   
 * 2. Replace it with this line:
 *     ```
       $command = sprintf( 'ABSPATH=%s;cd %s;%s 2>&1;echo [-{-$(pwd)-}-]', $abs, $cwd, $cmd );
       ```
   
 * If it works, I’ll make the change to the next update of WPTerm.
    -  This reply was modified 8 years, 10 months ago by [bruandet](https://wordpress.org/support/users/bruandet/).
    -  This reply was modified 8 years, 10 months ago by [bruandet](https://wordpress.org/support/users/bruandet/).
    -  This reply was modified 8 years, 10 months ago by [bruandet](https://wordpress.org/support/users/bruandet/).
      Reason: Edited because backticks in the code secion messed with the forum 
      code tag
 *  [oliverjuwig](https://wordpress.org/support/users/oliverjuwig/)
 * (@oliverjuwig)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/error-message-173-2/#post-9410758)
 * Hi,
 * something changed. The error message is now:
 * WPTerm: error 2
 * Sorry, Oliver
 *  [oliverjuwig](https://wordpress.org/support/users/oliverjuwig/)
 * (@oliverjuwig)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/error-message-173-2/#post-9410766)
 * debug.txt in this case:
 * -$res = Array
    ========= -$ret_var = 2
 *  Plugin Author [bruandet](https://wordpress.org/support/users/bruandet/)
 * (@bruandet)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/error-message-173-2/#post-9410791)
 * I can’t paste the exact command on this forum because it makes use of ‘backticks’;
   the forum interprets them as markdown elements.
    Here it is on pastebin: [https://pastebin.com/JY9UZkww](https://pastebin.com/JY9UZkww)
    -  This reply was modified 8 years, 10 months ago by [bruandet](https://wordpress.org/support/users/bruandet/).
 *  [oliverjuwig](https://wordpress.org/support/users/oliverjuwig/)
 * (@oliverjuwig)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/error-message-173-2/#post-9410800)
 * Great, works now. Thanks a lot for your support.
 * Best regards
 * Oliver

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Error message’ is closed to new replies.

 * ![](https://ps.w.org/wpterm/assets/icon-256x256.png?rev=1631724)
 * [WPTerm](https://wordpress.org/plugins/wpterm/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpterm/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpterm/)
 * [Active Topics](https://wordpress.org/support/plugin/wpterm/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpterm/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpterm/reviews/)

 * 9 replies
 * 3 participants
 * Last reply from: [oliverjuwig](https://wordpress.org/support/users/oliverjuwig/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/error-message-173-2/#post-9410800)
 * Status: resolved