Skip to Content

PHP in Netweaver Platform

 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

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

  5. Open NWDS and create new Web Application Project JavaBridge

  7. Right click on project name and choose import file

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

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

  13. Create a new Enterprise Application Project “JavaBridgeEAR”

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

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

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

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

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


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.

You must be Logged on to comment or reply to a post.
  • 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????

  • 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...



    • 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 🙂


  • 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/[.sh]|[.exe]".
    Please see "php_exec" in your WEB-INF/web.xml and WEB-INF/cgi/README for details.], with root cause [ php-cgi: not found].

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

    Thanks in advance

    • 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.


  • 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/[.sh]|[.exe]".
    Please see "php_exec" in your WEB-INF/web.xml and WEB-INF/cgi/README for details.], with root cause [ php-cgi: not found].
    Exception id: [00144F730D74006C000000D4000044B20004474BDAE6452C]

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


  • Hi,

    deployemnt ends with a warning


      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 : (Failed in component: JavaEE/com.JavaBridgeEAR, ) Initialization of servlet [PhpCGIServlet] failed. Check init() method of servlet. Error is: [javax.servlet.ServletException: Could not connect to server]


    and I'm not able to the the result.

    how to solve this?

    Thanks in advance.

  • 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.