Re: [U2] Error 4 22 from PHP exec of uv on AIX
That is pretty much dead on. Some things to note: I decided not to go through the headache of compiling php and apache myself on AIX. There are some wonderful folks at a community college that created packages for smit. http://pware.hvcc.edu/ http://pware.hvcc.edu/I typed up everything I did to get it installed, so if anyone is interested, let me know. The idea is not to use the AIX/Universe machine as a webserver, but, to use Apache/PHP to receive requests from a webserver. So its possible that the pware folks put that environment setting in their build of apache. I don't know enough about it to say one way or the other. Whatever the case may be, you can find what apache and php are doing by using the following php script, and calling it in a browser (NOT a shell). pre ?php echo system('set'); //Display the environment. $path = '/path-to-valid-universe-account'; chdir($path); putenv('LDR_CNTRL='); //Setting it equal to nothing works. //exec('unset LDR_CNTRL'); //Executing unset does not work. echo 'BEFORE Universe is executed.' . br/; echo system('/usr/ibm/uv/bin/uv 21'); //Be sure and redirect stderr to stdout. echo 'AFTER Universe is executed' . br/; ? /pre The echo system('set'); and the redirection of universe's stderr to stdout should let you see what is happening. Then to actually get universe to fire up, you can just follow Kevin's example. ?php $current = getenv('LDR_CNTRL');//Get the current value. On my system it was set to LDR_CNTRL=MAXDATA=0x8000 putenv('LDR_CNTRL='); //Set it to equal to nothing. exec('/usr/ibm/uv/bin/uv');//Fire up Universe. putenv('LDR_CNTRL=' . $current); //Put it back after universe exits. ? This is on Universe 10.3.4 on AIX 5.3. I'm guessing the same problem would exist on version 11 too. I did call our support with Rocket and they were clueless, so I'll probably email it on over to them (just to be a good messenger). Also someone posted this link earlier from the IBM website. http://publib.boulder.ibm.com/infocenter/tivihelp/v2r1/index.jsp?topic=/com.ibm.itame3.doc_5.1/am51_perftune113.htm On Sat, May 7, 2011 at 12:11 AM, Kevin King precisonl...@gmail.com wrote: When John and I were working on this we noticed that the LDR_CNTRL environment variable wasn't set at all on a normal telnet login. When we DID set it manually on the telnet session, Universe wouldn't start with the 4 22 message. So the simplest version the script was basically like this (and forgive me as I'm reciting from memory): ?php $current = getenv('LDR_CNTRL'); putenv('LDR_CNTRL='); exec('/u1/uv/bin/uv'); putenv('LDR_CNTRL=' . $current); ? John has been working on this more after we got this far so I'll defer to him for more details. Note that all this script was proving was the ability to start UV successfully from a PHP script invoked through Apache. There is more going on with moving data in and out of UV using JSON, which allows massive amounts of structured data to be moved into and out of the environment. -K ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users -- John Thompson ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
[U2] Error 4 22 from PHP exec of uv on AIX
I thought I would resurrect an old issue I found on the mailing list... As I am not a mailing list junky (google and web forums have spoiled me), I'm not entirely sure how to reply directly to the old post... Original Post From: Ross Morrissey Fri, 24 Jul 2009 14:11:56 -0700 This is a bit of a stumper (for me, anyway). I'm having issues trying to exec uv from PHP on AIX. Things work just fine in Windows (Apache or IIS) or Linux (Apache) so I know my PHP syntax is fine. On the AIX (5.2 uv 10.2.7) box: Using PHP, I can exec 'echo 1 + 2 | bc' and get 3 I can run this at the shell as user nobody: 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' I can get a CGI script to return 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' correctly With PHP, I can't exec ' /u2/uv/bin/uv display 42' (after a chdir). UV throws this error (into the Apache logs): An error has occurred during uniVerse initialization Please contact the system administrator Error code: 4 22 The codes translate into: 4. System V semaphores are probably not configured in the kernel. 22. (EINVAL) Invalid argument. Here are some examples of invalid arguments: dismounting a nonmounted device, mentioning an unknown signal in signal, reading or writing a file for which seek has generated a negative pointer. EINVAL is also set by math functions. Has anyone else bumped into this? IBM support suggested it might be an issue with SIGTTOU but this seems unlikely to me - especially for a one-line command. PHP is a bit outside their bailiwick. Thanks, Ross. End of Original Post I am having the exact same problem. I have tried using nohup before called universe. There is something about when apache calls the php script, then the php script executing universe, that universe does not like... Anyone ever figure out a way around this? -- John Thompson ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
Have you tried instead of ; to separate the cd and uv commands? rex On Fri, May 6, 2011 at 11:56 AM, John Thompson jthompson...@gmail.com wrote: I thought I would resurrect an old issue I found on the mailing list... As I am not a mailing list junky (google and web forums have spoiled me), I'm not entirely sure how to reply directly to the old post... Original Post From: Ross Morrissey Fri, 24 Jul 2009 14:11:56 -0700 This is a bit of a stumper (for me, anyway). I'm having issues trying to exec uv from PHP on AIX. Things work just fine in Windows (Apache or IIS) or Linux (Apache) so I know my PHP syntax is fine. On the AIX (5.2 uv 10.2.7) box: Using PHP, I can exec 'echo 1 + 2 | bc' and get 3 I can run this at the shell as user nobody: 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' I can get a CGI script to return 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' correctly With PHP, I can't exec ' /u2/uv/bin/uv display 42' (after a chdir). UV throws this error (into the Apache logs): An error has occurred during uniVerse initialization Please contact the system administrator Error code: 4 22 The codes translate into: 4. System V semaphores are probably not configured in the kernel. 22. (EINVAL) Invalid argument. Here are some examples of invalid arguments: dismounting a nonmounted device, mentioning an unknown signal in signal, reading or writing a file for which seek has generated a negative pointer. EINVAL is also set by math functions. Has anyone else bumped into this? IBM support suggested it might be an issue with SIGTTOU but this seems unlikely to me - especially for a one-line command. PHP is a bit outside their bailiwick. Thanks, Ross. End of Original Post I am having the exact same problem. I have tried using nohup before called universe. There is something about when apache calls the php script, then the php script executing universe, that universe does not like... Anyone ever figure out a way around this? -- John Thompson ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
Yep, the same behavior still happens. The issue is: On AIX 5.3 (Technology Level 9) You can do the following: -Call Universe from a php script from a shell. So if I do: php -f scriptname.php The php script, is changing the directory and firing up universe. Everything works fine from the shell. -If I run that same script through the browser (i.e. Apache 2.2 on AIX), then universe will crash with: An error has occurred during uniVerse initialization Please contact the system administrator Error code: 4 22 Rocket's suggestion is to run it with nohup, which did NOT work. Its not a permissions issue. I made them wide open (777) as a test, and I can call the php script from the shell of the user that Apache runs as, and they work fine- Universe fires up and does its thing. Universe does not get to the point to where it can even call the login proc. It crashes before it can even start. On Fri, May 6, 2011 at 12:17 PM, Rex Gozar rgo...@gmail.com wrote: Have you tried instead of ; to separate the cd and uv commands? rex On Fri, May 6, 2011 at 11:56 AM, John Thompson jthompson...@gmail.com wrote: I thought I would resurrect an old issue I found on the mailing list... As I am not a mailing list junky (google and web forums have spoiled me), I'm not entirely sure how to reply directly to the old post... Original Post From: Ross Morrissey Fri, 24 Jul 2009 14:11:56 -0700 This is a bit of a stumper (for me, anyway). I'm having issues trying to exec uv from PHP on AIX. Things work just fine in Windows (Apache or IIS) or Linux (Apache) so I know my PHP syntax is fine. On the AIX (5.2 uv 10.2.7) box: Using PHP, I can exec 'echo 1 + 2 | bc' and get 3 I can run this at the shell as user nobody: 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' I can get a CGI script to return 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' correctly With PHP, I can't exec ' /u2/uv/bin/uv display 42' (after a chdir). UV throws this error (into the Apache logs): An error has occurred during uniVerse initialization Please contact the system administrator Error code: 4 22 The codes translate into: 4. System V semaphores are probably not configured in the kernel. 22. (EINVAL) Invalid argument. Here are some examples of invalid arguments: dismounting a nonmounted device, mentioning an unknown signal in signal, reading or writing a file for which seek has generated a negative pointer. EINVAL is also set by math functions. Has anyone else bumped into this? IBM support suggested it might be an issue with SIGTTOU but this seems unlikely to me - especially for a one-line command. PHP is a bit outside their bailiwick. Thanks, Ross. End of Original Post I am having the exact same problem. I have tried using nohup before called universe. There is something about when apache calls the php script, then the php script executing universe, that universe does not like... Anyone ever figure out a way around this? -- John Thompson ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users -- John Thompson ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
Sounds to me like it has something to do with shell environment not being what is expected. Something like maybe the path doesn't include a needed directory. I'm not a PHP programmer, though, so it's just a WAG on my part. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of John Thompson Sent: Friday, May 06, 2011 9:42 AM To: U2 Users List Subject: Re: [U2] Error 4 22 from PHP exec of uv on AIX Yep, the same behavior still happens. The issue is: On AIX 5.3 (Technology Level 9) You can do the following: -Call Universe from a php script from a shell. So if I do: php -f scriptname.php The php script, is changing the directory and firing up universe. Everything works fine from the shell. -If I run that same script through the browser (i.e. Apache 2.2 on AIX), then universe will crash with: An error has occurred during uniVerse initialization Please contact the system administrator Error code: 4 22 Rocket's suggestion is to run it with nohup, which did NOT work. Its not a permissions issue. I made them wide open (777) as a test, and I can call the php script from the shell of the user that Apache runs as, and they work fine- Universe fires up and does its thing. Universe does not get to the point to where it can even call the login proc. It crashes before it can even start. On Fri, May 6, 2011 at 12:17 PM, Rex Gozar rgo...@gmail.com wrote: Have you tried instead of ; to separate the cd and uv commands? rex On Fri, May 6, 2011 at 11:56 AM, John Thompson jthompson...@gmail.com wrote: I thought I would resurrect an old issue I found on the mailing list... As I am not a mailing list junky (google and web forums have spoiled me), I'm not entirely sure how to reply directly to the old post... Original Post From: Ross Morrissey Fri, 24 Jul 2009 14:11:56 -0700 This is a bit of a stumper (for me, anyway). I'm having issues trying to exec uv from PHP on AIX. Things work just fine in Windows (Apache or IIS) or Linux (Apache) so I know my PHP syntax is fine. On the AIX (5.2 uv 10.2.7) box: Using PHP, I can exec 'echo 1 + 2 | bc' and get 3 I can run this at the shell as user nobody: 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' I can get a CGI script to return 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' correctly With PHP, I can't exec ' /u2/uv/bin/uv display 42' (after a chdir). UV throws this error (into the Apache logs): An error has occurred during uniVerse initialization Please contact the system administrator Error code: 4 22 The codes translate into: 4. System V semaphores are probably not configured in the kernel. 22. (EINVAL) Invalid argument. Here are some examples of invalid arguments: dismounting a nonmounted device, mentioning an unknown signal in signal, reading or writing a file for which seek has generated a negative pointer. EINVAL is also set by math functions. Has anyone else bumped into this? IBM support suggested it might be an issue with SIGTTOU but this seems unlikely to me - especially for a one-line command. PHP is a bit outside their bailiwick. Thanks, Ross. End of Original Post I am having the exact same problem. I have tried using nohup before called universe. There is something about when apache calls the php script, then the php script executing universe, that universe does not like... Anyone ever figure out a way around this? -- John Thompson ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users -- John Thompson ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
As a workaround, you could try u2pipe: http://www.pickwiki.com/cgi-bin/wiki.pl?U2pipe You wouldn't need to install it as a inet service, just use it as a pipe. For example: echo display 42|/usr/local/bin/u2pipe (or wherever you install it) To configure u2pipe, you edit /etc/u2pipe.ini to enter the user, password, and account. Any commands you pipe to it will run in universe and the output will go to stdout. rex ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
this sounds like a permissions issue. probably, the user that apache is running under doesn't have the permissions to execute the uv program in .../uv/bin George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users- boun...@listserver.u2ug.org] On Behalf Of John Thompson Sent: Friday, May 06, 2011 11:57 AM To: u2-users@listserver.u2ug.org Subject: [U2] Error 4 22 from PHP exec of uv on AIX I thought I would resurrect an old issue I found on the mailing list... As I am not a mailing list junky (google and web forums have spoiled me), I'm not entirely sure how to reply directly to the old post... Original Post From: Ross Morrissey Fri, 24 Jul 2009 14:11:56 -0700 This is a bit of a stumper (for me, anyway). I'm having issues trying to exec uv from PHP on AIX. Things work just fine in Windows (Apache or IIS) or Linux (Apache) so I know my PHP syntax is fine. On the AIX (5.2 uv 10.2.7) box: Using PHP, I can exec 'echo 1 + 2 | bc' and get 3 I can run this at the shell as user nobody: 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' I can get a CGI script to return 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' correctly With PHP, I can't exec ' /u2/uv/bin/uv display 42' (after a chdir). UV throws this error (into the Apache logs): An error has occurred during uniVerse initialization Please contact the system administrator Error code: 4 22 The codes translate into: 4. System V semaphores are probably not configured in the kernel. 22. (EINVAL) Invalid argument. Here are some examples of invalid arguments: dismounting a nonmounted device, mentioning an unknown signal in signal, reading or writing a file for which seek has generated a negative pointer. EINVAL is also set by math functions. Has anyone else bumped into this? IBM support suggested it might be an issue with SIGTTOU but this seems unlikely to me - especially for a one-line command. PHP is a bit outside their bailiwick. Thanks, Ross. End of Original Post I am having the exact same problem. I have tried using nohup before called universe. There is something about when apache calls the php script, then the php script executing universe, that universe does not like... Anyone ever figure out a way around this? -- John Thompson ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
Thanks for all of your replies. Thanks to Bob Woodward for the shell environment idea. Thanks to Kevin King for his help. Apache sets extra environment variables when compared to the shell of a regular user. One of these environment variables is called: LDR_CNTRL Apparently it has something to do with the way AIX handles the memory space. See: http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp?topic=/com.ibm.java.doc.user.aix32.60/user/aix_ldr_cntrl_page_sizes.html Apache seems to set the following when it starts a session: LDR_CNTRL=MAXDATA=0x8000 If you set this to null in a php script, then Universe will run just fine. Anyone have any ideas on the proper use of LDR_CNTRL? On Fri, May 6, 2011 at 1:06 PM, George Gallen ggal...@wyanokegroup.comwrote: this sounds like a permissions issue. probably, the user that apache is running under doesn't have the permissions to execute the uv program in .../uv/bin George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users- boun...@listserver.u2ug.org] On Behalf Of John Thompson Sent: Friday, May 06, 2011 11:57 AM To: u2-users@listserver.u2ug.org Subject: [U2] Error 4 22 from PHP exec of uv on AIX I thought I would resurrect an old issue I found on the mailing list... As I am not a mailing list junky (google and web forums have spoiled me), I'm not entirely sure how to reply directly to the old post... Original Post From: Ross Morrissey Fri, 24 Jul 2009 14:11:56 -0700 This is a bit of a stumper (for me, anyway). I'm having issues trying to exec uv from PHP on AIX. Things work just fine in Windows (Apache or IIS) or Linux (Apache) so I know my PHP syntax is fine. On the AIX (5.2 uv 10.2.7) box: Using PHP, I can exec 'echo 1 + 2 | bc' and get 3 I can run this at the shell as user nobody: 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' I can get a CGI script to return 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' correctly With PHP, I can't exec ' /u2/uv/bin/uv display 42' (after a chdir). UV throws this error (into the Apache logs): An error has occurred during uniVerse initialization Please contact the system administrator Error code: 4 22 The codes translate into: 4. System V semaphores are probably not configured in the kernel. 22. (EINVAL) Invalid argument. Here are some examples of invalid arguments: dismounting a nonmounted device, mentioning an unknown signal in signal, reading or writing a file for which seek has generated a negative pointer. EINVAL is also set by math functions. Has anyone else bumped into this? IBM support suggested it might be an issue with SIGTTOU but this seems unlikely to me - especially for a one-line command. PHP is a bit outside their bailiwick. Thanks, Ross. End of Original Post I am having the exact same problem. I have tried using nohup before called universe. There is something about when apache calls the php script, then the php script executing universe, that universe does not like... Anyone ever figure out a way around this? -- John Thompson ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users -- John Thompson ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
http://publib.boulder.ibm.com/infocenter/tivihelp/v2r1/index.jsp?topic=/com. ibm.itame3.doc_5.1/am51_perftune113.htm It is a good idea to unset the LDR_CNTRL environment variable, so that it does not unintentionally affect other processes. Regards, Glen Batchelor IT Director/CIO/CTO All-Spec Industries phone: (910) 332-0424 fax: (910) 763-5664 E-mail: webmas...@all-spec.com Web: http://www.all-spec.com Blog: http://blog.all-spec.com -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users- boun...@listserver.u2ug.org] On Behalf Of John Thompson Sent: Friday, May 06, 2011 2:46 PM To: U2 Users List Subject: Re: [U2] Error 4 22 from PHP exec of uv on AIX Thanks for all of your replies. Thanks to Bob Woodward for the shell environment idea. Thanks to Kevin King for his help. Apache sets extra environment variables when compared to the shell of a regular user. One of these environment variables is called: LDR_CNTRL Apparently it has something to do with the way AIX handles the memory space. See: http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp?topic=/com .ibm.java.doc.user.aix32.60/user/aix_ldr_cntrl_page_sizes.html Apache seems to set the following when it starts a session: LDR_CNTRL=MAXDATA=0x8000 If you set this to null in a php script, then Universe will run just fine. Anyone have any ideas on the proper use of LDR_CNTRL? On Fri, May 6, 2011 at 1:06 PM, George Gallen ggal...@wyanokegroup.comwrote: this sounds like a permissions issue. probably, the user that apache is running under doesn't have the permissions to execute the uv program in .../uv/bin George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users- boun...@listserver.u2ug.org] On Behalf Of John Thompson Sent: Friday, May 06, 2011 11:57 AM To: u2-users@listserver.u2ug.org Subject: [U2] Error 4 22 from PHP exec of uv on AIX I thought I would resurrect an old issue I found on the mailing list... As I am not a mailing list junky (google and web forums have spoiled me), I'm not entirely sure how to reply directly to the old post... Original Post From: Ross Morrissey Fri, 24 Jul 2009 14:11:56 -0700 This is a bit of a stumper (for me, anyway). I'm having issues trying to exec uv from PHP on AIX. Things work just fine in Windows (Apache or IIS) or Linux (Apache) so I know my PHP syntax is fine. On the AIX (5.2 uv 10.2.7) box: Using PHP, I can exec 'echo 1 + 2 | bc' and get 3 I can run this at the shell as user nobody: 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' I can get a CGI script to return 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' correctly With PHP, I can't exec ' /u2/uv/bin/uv display 42' (after a chdir). UV throws this error (into the Apache logs): An error has occurred during uniVerse initialization Please contact the system administrator Error code: 4 22 The codes translate into: 4. System V semaphores are probably not configured in the kernel. 22. (EINVAL) Invalid argument. Here are some examples of invalid arguments: dismounting a nonmounted device, mentioning an unknown signal in signal, reading or writing a file for which seek has generated a negative pointer. EINVAL is also set by math functions. Has anyone else bumped into this? IBM support suggested it might be an issue with SIGTTOU but this seems unlikely to me - especially for a one-line command. PHP is a bit outside their bailiwick. Thanks, Ross. End of Original Post I am having the exact same problem. I have tried using nohup before called universe. There is something about when apache calls the php script, then the php script executing universe, that universe does not like... Anyone ever figure out a way around this? -- John Thompson ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users -- John Thompson ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
Thanks for the link :) That helps. On Fri, May 6, 2011 at 3:16 PM, Glen Batchelor webmas...@all-spec.comwrote: http://publib.boulder.ibm.com/infocenter/tivihelp/v2r1/index.jsp?topic=/com . ibm.itame3.doc_5.1/am51_perftune113.htm It is a good idea to unset the LDR_CNTRL environment variable, so that it does not unintentionally affect other processes. Regards, Glen Batchelor IT Director/CIO/CTO All-Spec Industries phone: (910) 332-0424 fax: (910) 763-5664 E-mail: webmas...@all-spec.com Web: http://www.all-spec.com Blog: http://blog.all-spec.com -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users- boun...@listserver.u2ug.org] On Behalf Of John Thompson Sent: Friday, May 06, 2011 2:46 PM To: U2 Users List Subject: Re: [U2] Error 4 22 from PHP exec of uv on AIX Thanks for all of your replies. Thanks to Bob Woodward for the shell environment idea. Thanks to Kevin King for his help. Apache sets extra environment variables when compared to the shell of a regular user. One of these environment variables is called: LDR_CNTRL Apparently it has something to do with the way AIX handles the memory space. See: http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp?topic=/com .ibm.java.doc.user.aix32.60/user/aix_ldr_cntrl_page_sizes.html Apache seems to set the following when it starts a session: LDR_CNTRL=MAXDATA=0x8000 If you set this to null in a php script, then Universe will run just fine. Anyone have any ideas on the proper use of LDR_CNTRL? On Fri, May 6, 2011 at 1:06 PM, George Gallen ggal...@wyanokegroup.comwrote: this sounds like a permissions issue. probably, the user that apache is running under doesn't have the permissions to execute the uv program in .../uv/bin George -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users- boun...@listserver.u2ug.org] On Behalf Of John Thompson Sent: Friday, May 06, 2011 11:57 AM To: u2-users@listserver.u2ug.org Subject: [U2] Error 4 22 from PHP exec of uv on AIX I thought I would resurrect an old issue I found on the mailing list... As I am not a mailing list junky (google and web forums have spoiled me), I'm not entirely sure how to reply directly to the old post... Original Post From: Ross Morrissey Fri, 24 Jul 2009 14:11:56 -0700 This is a bit of a stumper (for me, anyway). I'm having issues trying to exec uv from PHP on AIX. Things work just fine in Windows (Apache or IIS) or Linux (Apache) so I know my PHP syntax is fine. On the AIX (5.2 uv 10.2.7) box: Using PHP, I can exec 'echo 1 + 2 | bc' and get 3 I can run this at the shell as user nobody: 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' I can get a CGI script to return 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' correctly With PHP, I can't exec ' /u2/uv/bin/uv display 42' (after a chdir). UV throws this error (into the Apache logs): An error has occurred during uniVerse initialization Please contact the system administrator Error code: 4 22 The codes translate into: 4. System V semaphores are probably not configured in the kernel. 22. (EINVAL) Invalid argument. Here are some examples of invalid arguments: dismounting a nonmounted device, mentioning an unknown signal in signal, reading or writing a file for which seek has generated a negative pointer. EINVAL is also set by math functions. Has anyone else bumped into this? IBM support suggested it might be an issue with SIGTTOU but this seems unlikely to me - especially for a one-line command. PHP is a bit outside their bailiwick. Thanks, Ross. End of Original Post I am having the exact same problem. I have tried using nohup before called universe. There is something about when apache calls the php script, then the php script executing universe, that universe does not like... Anyone ever figure out a way around this? -- John Thompson ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users -- John Thompson ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
This is shell variables, You will need $UVHOME and $UVBIN setting otherwise uv does not work. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of John Thompson Sent: 06 May 2011 16:57 To: u2-users@listserver.u2ug.org Subject: [U2] Error 4 22 from PHP exec of uv on AIX I thought I would resurrect an old issue I found on the mailing list... As I am not a mailing list junky (google and web forums have spoiled me), I'm not entirely sure how to reply directly to the old post... Original Post From: Ross Morrissey Fri, 24 Jul 2009 14:11:56 -0700 This is a bit of a stumper (for me, anyway). I'm having issues trying to exec uv from PHP on AIX. Things work just fine in Windows (Apache or IIS) or Linux (Apache) so I know my PHP syntax is fine. On the AIX (5.2 uv 10.2.7) box: Using PHP, I can exec 'echo 1 + 2 | bc' and get 3 I can run this at the shell as user nobody: 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' I can get a CGI script to return 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' correctly With PHP, I can't exec ' /u2/uv/bin/uv display 42' (after a chdir). UV throws this error (into the Apache logs): An error has occurred during uniVerse initialization Please contact the system administrator Error code: 4 22 The codes translate into: 4. System V semaphores are probably not configured in the kernel. 22. (EINVAL) Invalid argument. Here are some examples of invalid arguments: dismounting a nonmounted device, mentioning an unknown signal in signal, reading or writing a file for which seek has generated a negative pointer. EINVAL is also set by math functions. Has anyone else bumped into this? IBM support suggested it might be an issue with SIGTTOU but this seems unlikely to me - especially for a one-line command. PHP is a bit outside their bailiwick. Thanks, Ross. End of Original Post I am having the exact same problem. I have tried using nohup before called universe. There is something about when apache calls the php script, then the php script executing universe, that universe does not like... Anyone ever figure out a way around this? -- John Thompson ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1325 / Virus Database: 1500/3618 - Release Date: 05/05/11 ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
LDR_CNTRL has to do with the settings for your temporary work space (as we used to call it) How much space to allocate for your process' heap and so on. Can you give a full PHP script showing how you got around this? I mean the entire script, just post it into the board here. -Original Message- From: John Thompson jthompson...@gmail.com To: U2 Users List u2-users@listserver.u2ug.org Sent: Fri, May 6, 2011 11:46 am Subject: Re: [U2] Error 4 22 from PHP exec of uv on AIX Thanks for all of your replies. Thanks to Bob Woodward for the shell environment idea. Thanks to Kevin King for his help. Apache sets extra environment variables when compared to the shell of a regular user. One of these environment variables is called: LDR_CNTRL Apparently it has something to do with the way AIX handles the memory space. See: http://publib.boulder.ibm.com/infocenter/javasdk/v6r0/index.jsp?topic=/com.ibm.java.doc.user.aix32.60/user/aix_ldr_cntrl_page_sizes.html Apache seems to set the following when it starts a session: LDR_CNTRL=MAXDATA=0x8000 If you set this to null in a php script, then Universe will run just fine. Anyone have any ideas on the proper use of LDR_CNTRL? ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
When John and I were working on this we noticed that the LDR_CNTRL environment variable wasn't set at all on a normal telnet login. When we DID set it manually on the telnet session, Universe wouldn't start with the 4 22 message. So the simplest version the script was basically like this (and forgive me as I'm reciting from memory): ?php $current = getenv('LDR_CNTRL'); putenv('LDR_CNTRL='); exec('/u1/uv/bin/uv'); putenv('LDR_CNTRL=' . $current); ? John has been working on this more after we got this far so I'll defer to him for more details. Note that all this script was proving was the ability to start UV successfully from a PHP script invoked through Apache. There is more going on with moving data in and out of UV using JSON, which allows massive amounts of structured data to be moved into and out of the environment. -K ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
This is a snip from my php handler for a unidata program $udtCmd=LANG=en_US.UTF-8;export LANG; cd /usr/ud/accounts/$account;/usr/ud71/bin/udt RUN $BP flyGen $noads $style $uid $keywords -G; $result = array(); $i=1; $done=0; $time_start = microtime(true); exec( $udtCmd, $result); $time_end = microtime(true); foreach ( $result as $v ) { Notice i do set an env var in the same command as the udt command and i put the full path in as well. This works fine. Rgds Symeon. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Ross Morrissey Sent: 27 July 2009 21:01 To: U2 Users List Subject: Re: [U2] Error 4 22 from PHP exec of uv on AIX Thanks Henry, this sent me down another path of exploration. I ran my PHP script from the command line (php connect.php) and it got through to uv just fine - which makes it difficult to debug further. I was able to compare user and environment variables and there are no smoking guns. If I can't get this working using PHP as an Apache module, maybe I'll hook it up via CGI. Thanks again U2-Users! On Fri, Jul 24, 2009 at 6:54 PM, Henry Unger hun...@hitech.com wrote: Permissions, perhaps? Running it using syscalls might provide some clues. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
Thanks Symeon, that looks very similar to what I'm doing - and what works flawlessly on Linux/Apache, Windows/Apache, and Windows/IIS!!! The darn thing just won't work on AIX. On Tue, Jul 28, 2009 at 2:07 AM, Symeon Breen syme...@gmail.com wrote: This is a snip from my php handler for a unidata program $udtCmd=LANG=en_US.UTF-8;export LANG; cd /usr/ud/accounts/$account;/usr/ud71/bin/udt RUN $BP flyGen $noads $style $uid $keywords -G; $result = array(); $i=1; $done=0; $time_start = microtime(true); exec( $udtCmd, $result); $time_end = microtime(true); foreach ( $result as $v ) { Notice i do set an env var in the same command as the udt command and i put the full path in as well. This works fine. Rgds Symeon. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
Sorry, I'm on digest... Does the user executing this command have a profile setup with the paths to Universe? I've been working in UniData so it may be different, but the user has to have their environment setup to the correct paths to UniData bin, etc (UDTBIN = /blablabla/ud/bin). Shaun Ferguson Master Data Systems Analyst/Global Business Applications Wolseley plc - 12500 Jefferson Avenue - Newport News - VA - 23602-4314 T: (757) 989-2916 - F: (757) 989-2801 - E: shaun.fergu...@wolseley.com www.wolseley.com ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
Good guess, but I *always* use the full path to executable when I'm using anything other than telnet. On Mon, Jul 27, 2009 at 7:23 AM, shaun.fergu...@ferguson.com wrote: Sorry, I'm on digest... Does the user executing this command have a profile setup with the paths to Universe? I've been working in UniData so it may be different, but the user has to have their environment setup to the correct paths to UniData bin, etc (UDTBIN = /blablabla/ud/bin). ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
Thanks Henry, this sent me down another path of exploration. I ran my PHP script from the command line (php connect.php) and it got through to uv just fine - which makes it difficult to debug further. I was able to compare user and environment variables and there are no smoking guns. If I can't get this working using PHP as an Apache module, maybe I'll hook it up via CGI. Thanks again U2-Users! On Fri, Jul 24, 2009 at 6:54 PM, Henry Unger hun...@hitech.com wrote: Permissions, perhaps? Running it using syscalls might provide some clues. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
What account is Apache running as? Perhaps Apache does not have adequate permissions. Ross Morrissey wrote: Thanks Henry, this sent me down another path of exploration. I ran my PHP script from the command line (php connect.php) and it got through to uv just fine - which makes it difficult to debug further. I was able to compare user and environment variables and there are no smoking guns. If I can't get this working using PHP as an Apache module, maybe I'll hook it up via CGI. Thanks again U2-Users! On Fri, Jul 24, 2009 at 6:54 PM, Henry Unger hun...@hitech.com wrote: Permissions, perhaps? Running it using syscalls might provide some clues. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
[U2] Error 4 22 from PHP exec of uv on AIX
This is a bit of a stumper (for me, anyway). I'm having issues trying to exec uv from PHP on AIX. Things work just fine in Windows (Apache or IIS) or Linux (Apache) so I know my PHP syntax is fine. On the AIX (5.2 uv 10.2.7) box: Using PHP, I can exec 'echo 1 + 2 | bc' and get 3 I can run this at the shell as user nobody: 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' I can get a CGI script to return 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' correctly With PHP, I can't exec ' /u2/uv/bin/uv display 42' (after a chdir). UV throws this error (into the Apache logs): An error has occurred during uniVerse initialization Please contact the system administrator Error code: 4 22 The codes translate into: 4. System V semaphores are probably not configured in the kernel. 22. (EINVAL) Invalid argument. Here are some examples of invalid arguments: dismounting a nonmounted device, mentioning an unknown signal in signal, reading or writing a file for which seek has generated a negative pointer. EINVAL is also set by math functions. Has anyone else bumped into this? IBM support suggested it might be an issue with SIGTTOU but this seems unlikely to me - especially for a one-line command. PHP is a bit outside their bailiwick. Thanks, Ross. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Error 4 22 from PHP exec of uv on AIX
Permissions, perhaps? Running it using syscalls might provide some clues. Best regards, Henry Henry P. Unger Hitech Systems, Inc. http://www.hitech.com -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Ross Morrissey Sent: Friday, July 24, 2009 2:12 PM To: u2-users@listserver.u2ug.org Subject: [U2] Error 4 22 from PHP exec of uv on AIX This is a bit of a stumper (for me, anyway). I'm having issues trying to exec uv from PHP on AIX. Things work just fine in Windows (Apache or IIS) or Linux (Apache) so I know my PHP syntax is fine. On the AIX (5.2 uv 10.2.7) box: Using PHP, I can exec 'echo 1 + 2 | bc' and get 3 I can run this at the shell as user nobody: 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' I can get a CGI script to return 'cd /u2/uv/HS.SALES; /u2/uv/bin/uv display 42' correctly With PHP, I can't exec ' /u2/uv/bin/uv display 42' (after a chdir). UV throws this error (into the Apache logs): An error has occurred during uniVerse initialization Please contact the system administrator Error code: 4 22 The codes translate into: 4. System V semaphores are probably not configured in the kernel. 22. (EINVAL) Invalid argument. Here are some examples of invalid arguments: dismounting a nonmounted device, mentioning an unknown signal in signal, reading or writing a file for which seek has generated a negative pointer. EINVAL is also set by math functions. Has anyone else bumped into this? IBM support suggested it might be an issue with SIGTTOU but this seems unlikely to me - especially for a one-line command. PHP is a bit outside their bailiwick. Thanks, Ross. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users