[SOLVED] Error 217 from php lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- tintinux · 2012-12-01 17:37 Hi I have a small console program, used in a Linux web site. It was used to run from a php script like this : Code: [Select]$cmd = "/path/prog $p1 $p2 $ret = Array(); $code = -1 ; $output = exec( $cmd, $ret, $code ); Like this, I get an error 217 in $code and no output. I know this is related to initialization problem. I moved SysUtils in the first place in every "use". There is nothing complex in initialization sections, only a simple string assignment. It was compiled in 64 bits as is the server (Ubuntu 12.04 server). BTW : I have had the same error when it was compiled in 32 bits. This was fixed. When executed in a command line on the server like this  : Code: [Select]/path/prog P1 P2 P3 it works fine and output what is expected. And I'm sure that it worked fine from php some weeks ago, with the same executable file, not recompiled since. So, clearly, Lazarus is not faultly, but there must be something new that prevents normal execution. Of course I have not added "security"  features, or new options in the web server myself, but possibly something was added or changed during a server upgrade. But what ??? Has someone any idea ? Thanks ---------------------------------------------------------------------- Leledumbo · 2012-12-02 02:36 QuoteLike this, I get an error 217 in $code and no output. I know this is related to initialization problem. I moved SysUtils in the first place in every "use". There is nothing complex in initialization sections, only a simple string assignment. 217 is unhandled exception, and normally it has nothing to do with sysutils (string managers are registered by system unit). You better put a try except block in the main code and output the exception message so at least you'll get the output of what's wrong. Use information from this wiki article to get a full backtrace as well. ---------------------------------------------------------------------- tintinux · 2012-12-02 10:47 Thanks for your reply. I already had put a try except block in the main code, but I found an error raised from inside the exception ! That was why I had an unhandled error... Normal. Now, it works. Best regards