# How to see Ruby error when called from PHP

**URL:** <https://www.ruby-forum.com/t/how-to-see-ruby-error-when-called-from-php/115926>\
**Category:** Ruby\
**Created:** [September 30, 2007, 1:16pm UTC](https://www.ruby-forum.com/t/how-to-see-ruby-error-when-called-from-php/115926 "2007-09-30T13:16:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/e9c0ed/32.png) [@mark](https://www.ruby-forum.com/u/mark)\
**Post date:** [September 30, 2007, 1:16pm UTC](https://www.ruby-forum.com/t/how-to-see-ruby-error-when-called-from-php/115926/1 "2007-09-30T13:16:40Z")

</div>

I’m not seeing an error message when I call my Ruby script from PHP with

$s = sprintf(“ruby /Users/mark/scripts/myscript.rb \>  
/Users/mark/scripts/myscript.log &”);  
system($s);

I see print statements from my script in the log file, no errors.

The script is crashing on “requires ‘mysql’”

$LOAD\_PATH \<\< File.expand\_path(File.dirname( **FILE** ))  
require ‘rubygems’  
require ‘mysql’

I’m able to run the same script from crontab with the expand\_path.

Any ideas?
