I have some PHP scripts for creating products using rest api. All the script are under products_create_factory folder and this folder is in magneto2 root. When I execute a script from that folder from browser domain/products_create_factory/createproduct.php scripts gives 500 error.

BUT if I run the script from the console it executes.

Scripts are independent of app/bootstrap.php directory (use only rest api).

I have tried also this option even if scripts use only rest api.

How can I solve this problem?

1 Answer 1


First of all, you can try to find the error message. Try to check you log files or set developer mode and in app/bootstrap.php re-comment line

ini_set('display_errors', 1);

Error message can help you to find your bug

  • thanks for writing. I have already tried. I am getting Internal Server Error every time. but I can see my files throw that URL. I had delete also .htaccess file to check but it didn't work. :(
    – Phoenix404
    Commented Nov 8, 2018 at 8:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.