OK, I found the answer.
The problem was with my webserver configuration. I am using a fresh Arch linux installation - which uses apache 2.4.
With apache 2.4, some changes need to be done in the default parametrization of php to be able to run it with apache. In fact, I now had to configure it to use php-fpm and load in apache through fcgi.
I had thus to put the correct ProxyPass directive in the virtualhost conf in order for everything to work:
DocumentRoot /home/user/project/web
ProxyPassMatch ^/(.*)$ fcgi://127.0.0.1:9000/home/user/project/web/app.php/$1
Notably the ProxyPassMatch
directive needs to match ALL URLs, not only php files, as I am using URLS with no php ending for the API (e.g.http://localhost:7080/usuarios
)