500 Internal server error on php GET variables (CGI) - php

I'm currently writing a php API returning a JSON array. On my development environment everything seems to work fine.
So it was time for us to upload it on our dedicated server. But here is the deal. While our code is perfectly working on most environments, it is not on our server.
As I'm not an expert on multi-domain sites, we decided to try cPanel WHM, to easily configure our web server. Everything seems to work well, our API default page is running perfectly, showing the correct responses when a user is not permitted. As we are using custom urls, our .htaccess seems to work as well. But here is the rub! When I'm entering a $_GET variable to enter the API by using the correct keys, the server is automatically responding a 500 internal error.
I tried to look at the apache log file, it shows a
AH02812: attempt to invoke directory as script
I directly understood it was a httpd.conf problem. I replaced ScriptAlias by Alias, as most topics were saying. Now I don't have this error on my log, but its still showing the 500 internal server error.
We are currently running on Debian 7, with the latest stable version of cPanel. Our PHP version is 5.6.

Related

AWS Cloud9 PHP Web Server Form POST Error - Undefined Index

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
The issue was resolved by uninstalling PHP 5.4.16 and installing PHP 7.4

PHP script doesnt work in direct admin but work in cPanel

guys i have a PHP Script and i install it on Direct admin and i got this error
i have try change php version but its dont work
but i install this script on other host but in cPanel and its work fine
This page isn’t working avesk.net is currently unable to handle this request. HTTP ERROR 500
I'm not a professional. Explain a little simple what to do
why ? anyone can help me?
In DirectAdmin
There are several possible causes for receiving 500 error.
If you migrated your account from cPanel to DirectAdmin, check in public_html your .htacces file and remove everything that was created by cPanel, there is usually a comment before and after the code stating that this part was created by cPanel.
PHP version. Try to use in DirectAdmin the same version of PHP(cPanel) if possible.
Log in to DirectAdmin (at the user level)
If your server works with php-fpm, just below the domain name, there will be an option to change the PHP version of your account.
If your server work with CloudLinux, find the "Extra Features" menu and then "Select PHP Version". In this case you can change the version of PHP you want to use, and enable / disable PHP extensions (often a disabled extension can cause error 500).
If you have root access to the server, it is very likely that you will find some information in the log.
tail /var/log/httpd/domains/yourdomain.com.error.log
===
Regards

Why curl Couldn't resolve host intermittently?

I have a web service application that works fine in my local. I have even installed ngrok and I'm able to call it on the public web. But as I put my code on our production server I keep getting the 'Couldn't resolve host' error. I'm using different APIs in my service and intermittently I get this error. (I use apache in my local and nginx on prod)
For example I work with googleapis.com and sometimes it works and sometimes it doesn't on the server. The exact same code works just fine on my local.
It's worth mentioning that I've had this application for few months on this server and it's only this past few days that I've started to get these type of errors.
BTW I've noticed that the Curl version in my local and production and their settings are different but I don't know if that could be the source of the problem because it was working just fine.
I would appreciate any kind of guidance.

admin-ajax.php error 500 on windows

Got a question about admin-ajax.php. I have a wordpress site that we got developed and a form that uses this php file. this form uses AJAX and PHP to submit to the API that we use. a applyform-page-form.php file contains the Jquery and AJAX calls. These calls utilize a custom plugin to facilitate the XML process. All of the standard WordPress add_action(); calls are processed in this plugin. The site was developed on a Linux hosting panel (hostgator) and was working great. Due to PCI compliancy issues we needed to migrate the site to a Windows IIS host. Once we moved to this host, we get an error 500 with admin-ajax.php. I am stumped on what is causing this error. I checked permissions on the folder and they are fine. The server setup seems ok, we are using the same version of PHP on the windows server, Curl is installed, Not getting any errors in the iis server logs, php server logs are pretty much useless as well.
Question is does anyone know if there are any issues with admin-ajax.php on an IIS server? I have googled for a couple days and nothing about IIS, just mainly Apache and all the answers were basically "get a new host".
Well the thing is that Wordpress use a file call .HTACCESS where it maps the routes for events and request, so, what is hapend here is that you call admin-ajax.php from somewhere that has no "ROUTE", and that is why you have an error 500, but is just because the wordpress is trying to find something that it cand reach.
Try to use the full path to this file.

configure wamp apache for production environment

I have a web app am developing in-house and testing with wamp and it gives me all the normal results. PHP functions working well, errors reporting and responding when corrected. However, when I moved the site to a remote web hosting service, I get a Server 500 error as the first page tries to load. All the pages that have performed brilliantly in the local wamp setting suddenly reported errors with the same code.
I am wondering if there's something wrong in my wamp setting that makes it behave differently from the remote hosting sites. I have loaded the site on two linux hosting sites now with the same Serve 500 errors.
Please, I need help on how to tune my wamp for standard web operations so that I'd be sure to get the same results I get locally when I run it remotely.
Thanks

Categories