Add script php | Community
Skip to main content
August 22, 2025
Solved

Add script php

  • August 22, 2025
  • 1 reply
  • 449 views

Hello everyone,

I hope you are well.
We recently created a site with Adobe Experience Manager.
We would like to create a form and we have created the PHP script, but we don't know how to add it to Adobe Experience Manager.
In the template, we use the EmbeededContentIframe component, and can only add two types of content:
1/ iframeendpoint (link to the PHP)
2/ iframe script

The question is, is it possible to put the PHP code in Adobe Experience Manager (example: in assets and call it after)? 
Or how can we proceed if we don't want to put it on another server?

Sincerely,

Best answer by giuseppebaglio

Hi @rutchyra

you cannot directly run server-side PHP code because AEM is a Java-based CMS running on Java Servlet containers. PHP scripts must be executed by a PHP-enabled web server, which AEM itself does not support. 

 

I recommend rewriting the form using AEM Forms or Java Backend: 

  • Develop the form within AEM using AEM Forms, which are specifically designed for form management, validation, and submission.
  • AEM supports server-side form processing through Java servlets, Sling servlets, or integrated form handlers. This method eliminates the need for a separate PHP server, while providing full support within the AEM form ecosystem.
 

1 reply

giuseppebaglio
giuseppebaglioAccepted solution
Level 10
August 22, 2025

Hi @rutchyra

you cannot directly run server-side PHP code because AEM is a Java-based CMS running on Java Servlet containers. PHP scripts must be executed by a PHP-enabled web server, which AEM itself does not support. 

 

I recommend rewriting the form using AEM Forms or Java Backend: 

  • Develop the form within AEM using AEM Forms, which are specifically designed for form management, validation, and submission.
  • AEM supports server-side form processing through Java servlets, Sling servlets, or integrated form handlers. This method eliminates the need for a separate PHP server, while providing full support within the AEM form ecosystem.