AWS Cloud9 PHP Web Server Form POST Error - Undefined Index

124 views Asked by At

I have created a Cloud9 Environment on my Amazon Linux 2 EC2 Server used for a PHP development website, which also has Apache (httpd) installed for the live version of the website both currently use the exact same files and code.

On my Cloud9 Environment I am receiving an undefined index error when trying to access POST data from a form however on the live website the form works as expected with no errors and I can access the POST data from the form.

I'm unsure of what could be causing the issue, as far as I'm aware these environments will the same /etc/php.ini file configuration.

These are the versions installed on my EC2 server.

PHP 5.4.16 Apache 2.4.46

On the Cloud9 environment - I can see that the POST request was successful and that the POST variables have been returned in developer tools under the network tab, but I still receive the error on the page and cannot access the variables.

POST SUCCESSFUL

Is there any reason why the Cloud9 php web server environment would not allow these $_POST variables to be accessed?

Any help or suggestions are massively appreciated, I have been scratching my head at this for hours on end.

Also let me know if you would like me to post the code of the form, however it is just a basic form with one input field which obviously works on the live environment without any issues.

Cheers, Joab

1

There are 1 answers

0
joabhuntbach On

The issue was resolved by uninstalling PHP 5.4.16 and installing PHP 7.4