Symfony 2 on iseries

Symfony 2 on iseries

Postby bieleke on Wed Jun 15, 2011 1:56 pm

Hi Guys,

I run zend server on an ibm iseries aka power7 on os400 Release 7.1
Now i have installed the symfony2 framework (which has mainly nothing to do with the problem)

However, when i start a qshell and cd to /www/zendsvr
and run the command...

php-cli app/console

which should list the text below to be specific...

Symfony version 2.0.0-DEV - app/dev/debug

Usage:
[options] command [arguments]

Options:
--help -h Display this help message.
--quiet -q Do not output any message.
--verbose -v Increase verbosity of messages.
--version -V Display this program version.
--ansi -a Force ANSI output.
--no-interaction -n Do not ask any interactive question.
--shell -s Launch the shell.
--env -e The Environment name.
--no-debug Switches off debug mode.

Available commands:
help Displays help for a command (?)
list Lists commands

==================================================

furthermore all the app/console commands are listed,
BUT and now it comes.... the iseries does not produce
the above content, but it produces the garbage below...

$ $ $ _ë`_Ã?>` $ _ ÎÁÊËÑ?> $ _ àáî /øøÀÁÎÀÁÂÍÅ $ _ $ _íË/ÅÁ $ _ $?øÈÑ?>Ë) [?__/>À $/ÊÅÍ_Á>ÈË) $ _!øÈÑ?>Ë $ _
$ _ ÇÁ%ø $ _ $ _ Ç $ _ àÑËø%/` ÈÇÑË ÇÁ%ø _ÁËË/ÅÁ $ _ ÉÍÑÁÈ $ _ $ _ É $ _ à? >?È ?ÍÈøÍÈ />` _ÁË
Ë/ÅÁ $ _ ÎÁÊÂ?ËÁ $ _ $ _ Î $ _ ñ>[ÊÁ/ËÁ ÎÁÊÂ?ËÑÈ` ?à _ÁËË/ÅÁË $ _ ÎÁÊËÑ?> $ _ $ _ î $ _ àÑËø%/` ÈÇÑ
Ë øÊ?ÅÊ/_ ÎÁÊËÑ?> $ _ />ËÑ $ _ $ _ / $ _ ã?Ê[Á  +ëñ ?ÍÈøÍÈ $ _ >? Ñ>ÈÁÊ/[ÈÑ?> $ _ $ _ > $ _ à? >?È /Ë,
/>` Ñ>ÈÁÊ/[ÈÑÎÁ ÉÍÁËÈÑ?> $ _ ËÇÁ%% $ _ $ _ Ë $ _ </Í>[Ç ÈÇÁ ËÇÁ%% $ _ Á>Î $ _ $ _ Á $ _ èÇÁ á
>ÎÑÊ?>_Á>È >/_Á $ _ >? ÀÁÂÍÅ $ _ ëÏÑÈ[ÇÁË ?Ãà ÀÁÂÍÅ _?ÀÁ $ _ Î/Ñ%/Â%Á [?__/>ÀË $ _ $ _ÇÁ%ø

and so forth... hence i know what is written there because i know what the results should be :-)

CCSID = 37 on the system, also for nobody, nogroup and zendadmin users.

fastcgi.conf contains...

SetEnv="CCSID=819" SetEnv="LANG=en_US"

By the way, it is not possible to set the CCSID to 819 through the green screens as it says the 819 is invalid.

So i'm sure the above problem has to do with codepage stuff and more of that.
Also i cannot get why httpd.conf contains AddCharset UTF-8 .htm .html .xml
as the iseries is not capable of displaying UTF-8 ? Am i right ?

I hope somebody can help me fix the problem as this codepage garbage is frustrating.

Best Regards,

Patrick
bieleke
 
Posts: 4
Joined: Wed Dec 08, 2010 1:26 pm

Re: Symfony 2 on iseries

Postby erich_hieden on Wed Jun 15, 2011 3:23 pm

HI Patrick

First of httpd.conf and fastcgi.conf have nothing to do with php-cli. They are used to configure your apache instance.

Second use qp2term instead of qshell. There are a few defferences between them one of which is how they behave regarding to codepages.

Please show the full commands you are using. Now I can only guess and suppose the problem is your user profile which is causing the troubles.

Regards
erich_hieden
 
Posts: 349
Joined: Tue Jul 07, 2009 9:01 am

Re: Symfony 2 on iseries

Postby aseiden on Thu Jun 16, 2011 4:56 am

Yes, Martin ("Erich") has a good suggestion with CALL QP2TERM.

If that doesn't work, I've had success in similar situations by using Zend Studio's command shell that's included with its SSH remote server connections. In particular, I was upgrading SugarCRM and got "garbage" on qshell and qp2term, but I got readable text with Zend Studio's shell.

Alan
aseiden
 
Posts: 711
Joined: Thu Apr 09, 2009 5:45 pm

Re: Symfony 2 on iseries

Postby rangercairns on Mon Jun 20, 2011 7:34 pm

Excerpt from Yips link http://www.youngiprofessionals.com/wiki/FastCGI

Many people have trouble with “junk” being returned when using “qshell” (QSH). Usually what you see as junk characters is actually EBCDIC or ASCII being returned across stdout evoked script (stdout terminal window and/or green screen), but under the wrong terminal emulation expectation (ASCII when EBCDIC expected or visa versa). The general rule that will “cure” most of these issues is:

* call qp2term (PASE sh) - most PASE utilities run correctly under ASCII shell environment (PASE php-cli)
* qsh (qshell) - most ILE or “native” interfaces run correctly under EBCDIC shell environment
QSH can cross-load script from PASE, but the conversions going on under the covers can get script in trouble, which is mostly solved with script having a shebang !#/QOpenSys/usr/bin/sh at the top (whew):

HOWEVER default CCSID 65535 machines beware …

when using call qp2term, ssh myi, etc., i had to change parent shell job(s) ccsid to 37 before running command line php/pear worked with ibm_db2 SQL/XMLSERVICE (php-cli, pear, etc.).

* CHGJOB JOB(836270/ADC/QPADEV0004) CCSID(37)
* CHGJOB JOB(836268/ADC/QPADEV0004) CCSID(37)

Code: Select all
Example: Jobs I had to chgjob (37) ...
        QPADEV0004   ADC         BCI      .0  PGM-sshd         SELW
        QPADEV0004   ADC         BCI      .0  PGM-bsh          THDW   <-- this one
        QPADEV0004   ADC         BCI      .0  PGM-tcsh         TIMW   <-- this one

        QPADEV0004   ADC         INT      .1  PGM-QP2TERM      DEQW
        QPADEV0004   ADC         BCI      .1  PGM-sh           TIMW   <-- this one
... all shells from call qp2term or ssh connections to 65535 machine.

Then php command line db2 tests work ...
call qp2term -- after pops up use another screen to chgjob (37) to  PGM-sh
export PATH=/usr/local/zendsvr/bin:$PATH
export LIBPATH=/usr/local/zendsvr/lib
php-cli mytest.php
-- or --
php mytest.php
rangercairns
 
Posts: 212
Joined: Fri Jul 24, 2009 6:28 pm

Re: Symfony 2 on iseries

Postby bieleke on Sat Jul 09, 2011 11:17 am

First of all, thanks for all the thoughts that flow into this thread.

I already added a bug-report for this to the symfony2 forums, so if we can link this thread to the symfony2 thread you'll find here, we might came up with a solution in the future.
You can find this thread here... https://github.com/symfony/symfony/issues/1434

Ok, so first i tried to do all the things mentioned when i started the thread in qp2term, but with exactly the same results. Garbage all over the place.

As you can see i have tested exactly what the devs of SF2 asked me, and you can read the results in the thread.
So echo works as a charm, stdout doesn't.

So i start playing with QIBM_PASE_CCSID values and enhanced the echo script with two special chars, é and è to test that on the console.
This was the result... "Is this garbage ? And a special char é and è"

OK, so also some kind of utf-8 problem...

i ranned the command env and the ccsid values was this...

QIBM_PASE_CCSID=819

so i changed with "export QIBM_PASE_CCSID=1280 (this to change the ccsid to UTF-8)
However the result was the same...

then i changed CCSID to 37 (for the Netherlands)
This did not make sense, as the result was still the same for 819, 1280, 37 or even 65535

So this all feels as a major pain, and in meanwhile i ask myself if it is wise anyway to run your website on the iseries.
Because face it, if i always get junk instead of special chars and there is no way to fix that, how can you run your page if you are not from US where they do not use special chars ?

At least for the price you pay for an iseries server and the software- and hardware-contract i would expect IBM would provide some better support for all this.
Running on a windows server is no option anyway, as when you want to connect native to the DB/2 databases you are required to buy some or other tool
calles IBM Connect which cost over 500 bucks to simply be able to use their DB/2 database. However i have never seen that working, so it is understandable
the company is not willing to invest in a tool which you even don't know if that will fix all the problems.

Symfony2 runs GREAT on a windows or linux box, where UTF-8 is somewhat standard these days.

And ofcourse i thought about a zend-server license to get the support from zend itself, but face it, if i can't get this all running, why should i buy a license anyway ?

So let's put our heads together (the people here and the people of the Symfony2 dev team) to get this all going.
bieleke
 
Posts: 4
Joined: Wed Dec 08, 2010 1:26 pm

Re: Symfony 2 on iseries

Postby rodflohr on Mon Jul 11, 2011 4:41 am

One way to force the PASE shell (QP2TERM) to do the character conversion is to pipe through the cat function. Please try this:

php-cli app/console | cat
User avatar
rodflohr
 
Posts: 44
Joined: Mon Dec 29, 2008 5:28 pm

Re: Symfony 2 on iseries

Postby rodflohr on Mon Jul 11, 2011 4:52 am

Also, please consider Alan's reply above, to run your command line commands in an SSH terminal. This does work with the Help output for PEAR, which is also UTF-8. As Alan mentioned, Zend Studio includes an SSH terminal. To find it, right click on an "Ssh Shells" item under any SSH connection in the RSE Remote Systems pane and choose "Launch Shell." (If you do not have any SSH connections already set up, you will need to set one up first.) The shell will appear with a window to show output, and a separate text area to enter commands.

You can also use a terminal program that is SSH compatible. PuTTY is one such program available for free. You can try ExtraPutty, available here: http://www.extraputty.com/download.php
User avatar
rodflohr
 
Posts: 44
Joined: Mon Dec 29, 2008 5:28 pm

Re: Symfony 2 on iseries

Postby erich_hieden on Mon Jul 11, 2011 10:05 am

bieleke wrote:...
So this all feels as a major pain, and in meanwhile i ask myself if it is wise anyway to run your website on the iseries.
Because face it, if i always get junk instead of special chars and there is no way to fix that, how can you run your page if you are not from US where they do not use special chars ?
...


I think you still confuse running a website on the iSeries with calling a php script from PASE. Running a website doesn't make problems regarding special chars, the apache server converts your strings the way you configured it, nothing more and nothing less. And the standard configuration worked for me as well and I'm running on QCCSID 1141 (german) and do have special chars.

When calling things from QShell or QP2TERM you might come across problems you see now, but IMHO I think that this is just bad luck that Symfony uses a way to print it's output which the iSeries can't utilize. As I saw in your other thread you seem to overcome the problem by slightly altering Symfony, so do you still need help on this?

Regards

P.S I hope you enjoy working with PHP on System i, as it has a lot of advantages as well, even when it seems it only causes troubles, especially in the beginning.
erich_hieden
 
Posts: 349
Joined: Tue Jul 07, 2009 9:01 am

Re: Symfony 2 on iseries

Postby chris_hird on Thu Jul 14, 2011 5:20 pm

This thread on the iseries network forums shows a similar pattern which was fixed by setting the corrrect CGIDEV parameters. Not sure if its related as I have not used that software.

http://forums.systeminetwork.com/isnetf ... p?t=140141

Chris...
Shield Advanced Solutions Ltd
Home of JobQGenie and the Receiver Apply Program
http://www.shield.on.ca/Blog
chris_hird
 
Posts: 168
Joined: Fri Apr 10, 2009 12:41 am
Location: Toronto


Return to Zend Server for IBM i

Who is online

Users browsing this forum: No registered users and 1 guest