Skip to Content

 I like PHP. It is easy, powerfull and also open source. You can find plenty of applications written with php and you can use them freely. There are lots of web servers on which you can run PHP codes such as Apache, IIS etc.

I was thinking about adding SAP Netweaver Platform to this list. After I started to make some experiments, I found PHP/Java Bridge which combines PHP and Java together. You can use Java codes in PHP and also you can run PHP codes on your J2EE engine directly.  Many thanks to developers who made this great job.

I downloaded PHP/Java Bridge and deployed to SAP Netweaver. Yes, It worked.

Let’s go through the steps to configure PHP/JavaBridge on SAP Netweaver :

         

  1. Download php/Java bridge from http://sourceforge.net/project/showfiles.php?group_id=117793
  2.      

  3. Extract files find JavaBridge.war rename it to JavaBridge.zip and extract it to a new folder
  4.      

  5. Open NWDS and create new Web Application Project JavaBridge
  6.      

  7. Right click on project name and choose import file
  8.      

  9. Select your folder previously extracted from JavaBridge.war and select all files
  10.      

  11. Right Click on project name and click Build Web Arcieve
  12.      

  13. Create a new Enterprise Application Project “JavaBridgeEAR”
  14.      

  15. Right click on project name and select add modules. Then select project “JavaBridge”
  16.      

  17. Right click on project name and select Build Application Archieve
  18.      

  19. Right click on JavaBridgeEAR.ear and select Deploy to J2EE Engine
  20.      

  21. Open http://localhost:50000/JavaBridge/ and see the result :
         image
  22.      

  23. Execute “Test and general php info” and see the PHP configuration details
         image

 

As you see it is really easy to run PHP on Netweaver Platform. You can integrate many useful PHP applications and use them on your Portal.

In this blog, I only focused on running PHP on SAP J2EE engine. In the next blogs, I will show how you can integrate PHP applications and see the magic on Portal.

To report this post you need to login first.

19 Comments

You must be Logged on to comment or reply to a post.

  1. Kai Chalker
    Hi,

    Great blog and something I have been looking to use for a long time. We have a number of applications that have been developed in PHP and will be interested in your future blogs.

    Everything worked up to running the URL with the JavaBridge and then recieved an error saying “You are not authorized to view the content….”

    Any ideas????

    (0) 
      1. Kai Chalker
        Hi,

        Great, after recompiling it a few times and looking at the previous comments I have been able to get this to work now.  Look forward to any more advances in this area.

        Great Blog, many thanks
        Kai

        (0) 
  2. Alvaro Tejada Galindo
    Hi Abdul:

    Really nice blog…I wasn’t aware of that PHP/Java bridge…I’m not a Java lover but sure I’m a PHP lover -;)

    Looking forward for more blogs and complex examples…

    Greetings,

    Blag.

    (0) 
    1. Abdulbasit Gulsen Post author
      Hi Blag,

      Tnaks for your comments. I love Java but for some cases PHP is exteremely easier than Java. However, I’m not sure about production performance. For the time being; it will go like an experimental work. After some improvements, I will try to test for production performance.
      I will write new blogs soon for integration examples. After this integration scenarios, there will be a SAP specific add-ons and I’m planning to put this as community project for PHP lovers 🙂

      Regards
      Abdul.

      (0) 
  3. Ignacio Reiter
    Hi,

    Great blog. Thank you for the explanation, but i still have a problem with in the JavaBridge EAR in the netweaver platform.

    Error [javax.servlet.ServletException: An IO exception occured. Probably php was not installed as “/usr/bin/php-cgi” or “c:/php/php-cgi.exe”
    or “/usr/sap/DP1/JC01/j2ee/cluster/server0/apps/sap.com/JavaBridgeEAR/servlet_jsp/JavaBridge/root/WEB-INF/cgi/php-cgi-ppc64-aix[.sh]|[.exe]”.
    Please see “php_exec” in your WEB-INF/web.xml and WEB-INF/cgi/README for details.], with root cause [java.io.IOException: php-cgi: not found].

    Can you help me? Where I can find the file php-cgi-ppc64-aix[.sh]|[.exe]”.

    Thanks in advance

    (0) 
    1. Brijesh Verma
      Hi Estaban,

      Did you resolve this error. We also have same error with our diployment. Further, we want to deploy MediaWiki.tar ( A wiki in PHP) can you please guide us.

      Thanks in anticipation.

      Brijesh

      (0) 
      1. Norman Schröder
        One more to add:

        – when importing the file(s) (point 5) I had to change the parameter “Into folder” to only “JavaBridge” (default was “JavaBridge/webContent”)

        Regards,
        Norman Schröder

        (0) 
      2. Victor Capi
        Hi,

        I copy the folder php in the \usr\sap\DES\DVEBMGS00\j2ee\cluster\server0\apps\sap.com\JavaBridgeEAR\servlet_jsp\JavaBridge\root

        but continue with the same problem, any other idea?

        Thanks in advance,
        Regards,

        (0) 
  4. Brijesh Verma
    Hi Abdulbasit,

    Great Blog, We never thought that we can use PHP applications over Netweaver. We intend to use Wiki (WikiPedia in PHP)on our KM and were looking for some tool to deploy, This was great discovery.

    We followed your steps religiously , however at the end we got following error. We are on Netweaver 7.0.

    Please help.

      Application error occurred during request processing.
      Details:   Error [javax.servlet.ServletException: An IO exception occured. Probably php was not installed as “/usr/bin/php-cgi” or “c:/php/php-cgi.exe”
    or “/sapmnt/ECU/JC01/j2ee/cluster/server0/apps/sap.com/JavaBridgeEAR/servlet_jsp/JavaBridge/root/WEB-INF/cgi/php-cgi-sparcv9-sunos[.sh]|[.exe]”.
    Please see “php_exec” in your WEB-INF/web.xml and WEB-INF/cgi/README for details.], with root cause [java.io.IOException: php-cgi: not found].
    Exception id: [00144F730D74006C000000D4000044B20004474BDAE6452C]

    Please also suggest how do we deploy the mediawiki.tar (a Wiki application in PHP)

    Thanks
    Brijesh

    (0) 
  5. J. de Voijs

    Hi,

    deployemnt ends with a warning

    Description:

      1. Warning exception has been returned while the [JavaEE/com.JavaBridgeEAR] was starting. Warnings:[

    ][

    Warning occurred on server 363587550 during startApp of JavaEE/com.JavaBridgeEAR : com.sap.ASJ.web.000607 (Failed in component: JavaEE/com.JavaBridgeEAR, ) Initialization of servlet [PhpCGIServlet] failed. Check init() method of servlet. Error is: [javax.servlet.ServletException: php.java.bridge.http.FCGIConnectException: Could not connect to server]

    ]

    and I’m not able to the the result.

    how to solve this?

    Thanks in advance.

    (0) 
  6. J. de Voijs

    Hi Tom,

    I followed your procedure, this time no error, but I don’t see PHP/JAVA Bridges examples.

    I checked the the project and it is empty so the import of the war didn’t do anything.

    gr,

    Vo.

    (0) 

Leave a Reply