To make sure that the WordPress installation takes that 512 value you need to make sure that you also add it for WordPress please read this article for more information:
You can install this plugin and go to WordPress Dashboard > WP ServerInfo menu to see if the WordPress gets the correct PHP Memory Limit.
Also please follow this step:
Test for a plugin conflict. You can do this by deactivating all third-party plugins, and see if the problem remains. If it's fixed, you'll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.
kindly get back to us with the result of the steps above and URL/User/Pass of your WordPress dashboard using the Secure Note functionality of the post to follow up the case if you still have problems.