cadjou / grav-plugin-cadphp

Include PHP simply inside Grav CMS
MIT License
6 stars 0 forks source link

cadphp does not work reliably issue #4

Open adeliktas opened 3 years ago

adeliktas commented 3 years ago

i have installed the plugin through grav wui; uninstalled and then retried it with bin/gpm. Both were successful install without an error, but cadphp on the content page (<p>cadphp:p1:test</p>) was not being executed. There is also nothing in the logs. I managed to get it to run somehow (it was showing 'Hello the World' on the page..) when disabling and re-enabling the plugin over the grav wui, but when i created a new page it stopped working again and only displays 'cadphp:p1:test' on the page. I have no clue what causes this issue, if you have any idea i'm willing to provide any files/info.

/var/www/html/grav/user/config/plugins/cadphp.yaml: enabled: true p1: php/

default rest of cadphp.yaml p2: null p3: null p4: null p5: null functions_deny: - allow_url_fopen - allow_url_include - exec - shell_exec - system - passthru - popen - stream_select - ini_set

/var/www/html/grav/user/plugins/cadphp/php/test.php

<?php
return "Hello the World";

Edit: Clearing the Grav Cache did not solve this issue

cadjou commented 3 years ago

Hello @adeliktas,

Did you try to save the config by the admin interface (to recreate the file user/config/plugins/cadphp.yaml with Grav).

Can you tell me witch Grav version do you use ? I will try to repeat your problem.

Charles

adeliktas commented 3 years ago

Yes i have done that, the file content and file permissions on the new cadphp.yaml created over the admin interface is the same. (faa81afb8e0271e1196dae587c271814 cadphp.yaml faa81afb8e0271e1196dae587c271814 cadphp.yaml.old) I tested it and create a new page for it https://www.deliktas.de/tools/cadphp-test It worked on the first time showing: Hello the World, but after an edit of the content page and adding cadphp a second time it stopped working anymore..

<p>cadphp:p1:test</p>
<p>cadphp:p1:test</p>

removing the second line didn't revert it, it still doesn't work. showing: cadphp:p1:test

everything is up to date. Grav Version: Grav v1.7.7 - Admin v1.10.6

caston1981 commented 2 years ago

did you have any success? I am running v1.7.32 - Admin v1.10.32 and have installed cadphp. I tried putting cadphp:p1:test onto an existing page and nothing come up. I then tried entering cadphp:p1:test on a new page and it just outputted cadphp:p1:test.

OK I got it working now after cadjou's suggestion. I will continue and see how I go.