Site logo

Archived topic

PHP NOT USABLE

16 replies · Started by Carlos on October 24, 2018

Viewing posts 1–15 of 17

Hi,
I can´t disable the messaje Unable to execute PHP as DISALLOW_FILE_EDIT is defined. in PHP execute.

Is this an issue?

I have tried to remove this creating a code snippet.

Could you check if is right and help me to solve it please?.

Here screenshorts and short video of what i m doing.

https://cl.ly/dbbfeda30559
https://cl.ly/59c9839fc74b

https://cl.ly/59b043a3a13d
Thanks

Hi Carlos,

Looks like the code you are trying to add isn't PHP (javascript) so you shouldn't need to check the execute PHP option.

If you want to allow PHP execution anyways, you will need to go into wp-config file and remove that specific line here:
https://codex.wordpress.org/Hardening_WordPress#Disable_File_Editing

Let me know if this helps.

It's not an issue, it's just telling you that Hooks can't execute PHP as you have that turned off in the Dashboard.

You can:

a) Move from the old Hooks module to the new Elements module: https://docs.generatepress.com/article/moving-hooks-page-headers-to-elements/

b) Remove that message with this function:

add_action( 'after_setup_theme', function() {
    remove_action( 'admin_notices', 'generate_hooks_php_check' );
} );

Hi Tom,
A little confused about, because that messaje started because of security plugin.
I thought was an issue because the messaje was displayed, so i insert the code snippet in the plugin to disallow... for dissapear.

What should i do with that meesaje?remove it or leave it?
Im trying to insert a code to display a chat button but does not worrk. And i dont know if is because that can not execute php because i made dissapeared or because that code is not javassript as Leo says.

Please can you tell me what would you do with that?
And please can you tell me if the code i insert in code snippet plugin is correct or not Aparently messaje disappeared.
https://cl.ly/dbbfeda30559
https://cl.ly/59c9839fc74b

https://cl.ly/59b043a3a13d

Security plugins will sometimes make it so PHP can't be edited inside the WP Dashboard.

When that happens, the old GP Hooks plugins will tell you to do the same so Hooks don't accept PHP.

In the new Elements module, which is what Hooks turned into, the message is inside the Element itself while you're editing it.

I would personally remove the message using one of the methods I mentioned above.

That code you added in the second screenshot should be added to your wp-config.php file instead of the Code Snippets plugin.

However, you can probably just avoid all of this by telling your security plugin to allow file editing in the WP Dashboard.

Thank you Tom,
One more question please. I delete de code snippet from the plugin.
And messaje displayed again.
https://cl.ly/c8091a2e5621

My question is in which part of my wp-config.php, should i insert the code to remove the messaje DISALLOW_FILE_EDIT is defined?

Thank you again

Hi Tom,
I removed the messaje of DISALLOW_FILE_EDIT is defined in wp-config.php (1 screenshot https://cl.ly/f7b1a7085b6f)

and suppose i can to execute php in elements / Hooks?

Here i trying execute php, but i can´t. Maybe this code has to be as a header?, or what do you think is the problem for not being able execute PHP and display Unable to execute PHP as DISALLOW_FILE_EDIT is defined and probably doesn´t shows chat button for that reason.
(a Short video https://cl.ly/08ff72da4d78)

If you has told me the amswer yet and i didn´t understand sorry for that.
Trying to understand.

Thank you.

That code you're trying to add isn't PHP, it's javascript.

So you would have to put it inside <script> tags, like this:

<script>
    // Your code here
</script>

Then, is not enable to execute Php becacuse the code was not Php wasn't it?
So if i insert php could i execute?

Thanks
Carlos

Not unless you disable the option that disabled file editing in your security plugin.

Hi,
In which part of wp-config.php should i aad this code as you recomended me?

At the end?

b) Eliminar ese mensaje con esta función:

add_action( 'after_setup_theme', function() {
remove_action( 'admin_notices', 'generate_hooks_php_check' );
} );

Thanks
Carlos

That specific code can go into your Code Snippets plugin.

Hi Tom,
I pasted that code in code snippets, but still can´t execute PHP. What i doing wrong?

https://cl.ly/29343c0d4946

Hi again,
Deactivated the security plugin, now it is possible to execute .php. Do you think must talk to them to allow it?

Thanks

There should be a setting inside the security plugin that allows you to edit files. Which plugin are you using?

This archived topic is closed to new replies.