ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

PHP code test

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PHP code test

    Hi
    I am learning PHP.
    I need some help. Can some one tell if PHP code needs any compilation of source to form executable object?

    Test code from zend is working fine but when I copied same code and try to run then it is showing same code in hex but for copy from zend echo is perfect

    trying to call using -
    CALL PGM(QP2SHELL) +
    PARM('/usr/local/zend/core/bin/php-cli' +
    '/www/zendcore/htdocs/QBase/MYEMAIL.php')

    Can some one please help???

    thanks so much

  • #2
    Re: PHP code test

    PHP does not have to be compiled...it's a scripting language that is executed at run-time similar to javascript, etc.
    I'm not anti-social, I just don't like people -Tommy Holden

    Comment


    • #3
      Re: PHP code test

      When I am running this it is always showing only hex but same existing code giving correct output.
      Is there any setup or setting i need to do before running PHP

      Comment


      • #4
        Re: PHP code test

        Originally posted by instrucrat1 View Post
        When I am running this it is always showing only hex but same existing code giving correct output.
        Is there any setup or setting i need to do before running PHP
        Since you have not shown us your script we have no idea how your output is formed or indeed where you see it.

        Many people use the approach to launching a php script that you are describing without problems - so it has to be related to the script/environment where it is running.

        Give us more info and we may be able to help.


        Jon P

        Comment


        • #5
          Re: PHP code test

          Hi,
          I am running this script in iSeries V5R3.

          Below is script which is already existing and giving send status properly. I copied same with other name and trying to run it but it is giving weared output like all special char.


          (CALL PGM(QP2SHELL) +
          PARM('/usr/local/zend/core/bin/php-cli' +
          '/www/zendcore/htdocs/QBase/MYEMAIL.php') )

          <?php
          echo "<h3>Sending e-mail...</h3>";

          // The message
          $message = "Line 1 Line 2 Line 3";

          // In case any of our lines are larger than 70 characters, we should use wordwrap()
          // $message = wordwrap($message, 70);

          // Send
          $status = mail('xyz.nam@yahoo.com', 'My Subject', $message);

          If ($status == TRUE ) {
          echo "Status = SEND";
          } else {
          echo "Status = FAILED";
          }
          ?>

          Comment


          • #6
            Re: PHP code test

            OK, I found reason. When I was copying to STMF that time I was not changing CCSID to 1252 so was causing problem.
            Thank you

            Comment

            Working...
            X