To execute a php script directly in Workflows/API

Hello is it possible to execute a php script directly in Workflows/API

Thanks Morgan

Technically, the proper way would be creating a PHP Wappler extension so you can require/include a PHP script. I’m imagining a custom Step where you can fill in the path of the PHP script you want to include

The less correct way would be opening the .php file in a code editor and manually include the PHP script there :thinking: I suggest the first option instead

P.S.: I don’t use Wappler with PHP, so I don’t know if my advice is correct

You can maybe take a look at a simple PHP Wappler extension to see how it’s done:

There are very few cases where a PHP script is required when using Wappler. When this is required, then just create a PHP document and manually enter the code, as suggested by @Apple.

Out of interest, what does the PHP script do that Wappler cannot do?

We had a use case to run Ghostscript commands for some PDF manipulation.
We created a simple PHP file and called it as an API action in Wappler Server Action.
If you need more flexibility or options, you can configure a custom module extension as well.

2 Likes

Thank you for your feedback, my script converts my csv file to UTF8 before importing data into the database.
you say i can call just call my php file directly in API?

Have you had a look at using

Its use is explained here:

Hello, yes I use it precisely but the accents were not injected suddenly I was missing characters. my script still precisely in utf8 to no longer have this problem

Thanks indeed I can simply call a PHP page from an API call. it works

1 Like