My web application won’t launch, I’m getting a 500 error code. When I look in the error log file, I get entries like this:
[Tue Aug 28 11:42:38.643144 2018] [cgi:error] [pid 6878] [client :34985] AH01215: Can’t use an undefined value as a symbol reference at /var/www/html/mywebsite.cgi line 118.
[Tue Aug 28 11:42:38.646338 2018] [cgi:error] [pid 6878] [client :34985] End of script output before headers: mywebsite.cgi
So, I’m not sure about what’s going on (why can’t the report be more verbose?).
On my Mac, the app runs fine. I then compile it for Linux (my server’s OS), upload it with its resources folder and cgi file (as binary mode) set the permissions and error 500.
It looks like the hello.cgi file was created on a windows system using something like notepad. The ^M at the end of each line needs to be removed for it to work on unix.
@Arnaud Nicolet - make sure your FTP program is transmitting things correctly. The cgi and config files should be ASCII and just about everything else should be binary (unless youre copying other text files)
Permissions should be 755 on the CGI, app and the Libs directory and its contents. 644 on everything else.
FWIW, the error messages you are seeing come from your web server or the Perl interpreter itself. The Xojo app hasnt even launched yet, so theres no better error for us to provide.
Now, the error that you provided in the first post… that could be caused by the app crashing.
In the terminal go to the directory where your app is and try two these things:
[quote=403012:@Alberto De Poo]Also check if perl is in /usr/local/bin
[/quote]
It looks like this is the problem (I don’t get why, since it used to work).
ls /usr/local/bin returns this:
myvncserver noip2.
Edit: however, I have the /usr/bin/perl file already installed. My installation is broken?
Ok, I changed from Auto mode to explicit Binary/ASCII. Same error 500.
This led to this message:
Cannot write to config at path /var/www/html/test/config.cfg. Permission denied. So I added write permissions to that file and am back with the error code 500.
In my installation I have perl in /usr/bin/perl, that’s why my hello.cgi first line is #!/usr/bin/perl
So if your installation is the same, create a hello.cgi file, copy the code I posted above, change permissions to 755 and make sure it works. If it doesn’t work, then there is something missing in your webserver configuration.
[quote=403016:@Greg O’Lone]Now, the error that you provided in the first post… that could be caused by the app crashing.[/quote] How could it be crashing if the app hasn’t launched?
[quote=403016:@Greg O’Lone]In the terminal go to the directory where your app is and try two these things:
[quote=403061:@Alberto De Poo]In my installation I have perl in /usr/bin/perl, that’s why my hello.cgi first line is #!/usr/bin/perl
So if your installation is the same, create a hello.cgi file, copy the code I posted above, change permissions to 755 and make sure it works. If it doesn’t work, then there is something missing in your webserver configuration.[/quote]
Ok, so there’s something missing (same error). How can I know what is missing? Or can I reinstall perl?
Is not perl problem, is your webserver configuration.
I have seen some Apache installation with the cgi-bin directory not configured (can’t execute .cgi files on that server) and others without cgi-bin directory.
So you need to check your webserver configuration, make sure you have cgi configured and after the hello.cgi runs without error 500 then you could start looking at running Xojo web.
Which Linux distro? I’ve seen this in CentOS 6 (The 500 error) and always is gone by deleting the htaccess file in the application folder. Don’t know why. In CentOS 7 works with it, perhaps by the Apache version.
Sometimes getting this error if update the application, and the old one is running when open the new. Then killing the process solves it.
Yes. Cgi apps expect to get data from the cgi script and will quit automatically if they dont. What it does tell us is that there are no plugin library requirements that are not met in the open event.
Well, it is probably launching, however briefly, and then quitting again before it has a chance to respond. In terms of cgi web apps, thats usually due to a crash.
Have you tried an empty or simple web project to see if that works? One that we know has no other issues?
[quote=403069:@Alberto De Poo]Is not perl problem, is your webserver configuration.
I have seen some Apache installation with the cgi-bin directory not configured (can’t execute .cgi files on that server) and others without cgi-bin directory.
So you need to check your webserver configuration, make sure you have cgi configured and after the hello.cgi runs without error 500 then you could start looking at running Xojo web.[/quote]
What’s weird is it worked some weeks ago; but, the problem is solved (I’m going to answer to everyone and write what I’ve done in the end).
[quote=403147:@Greg O’Lone]Well, it is probably launching, however briefly, and then quitting again before it has a chance to respond. In terms of cgi web apps, thats usually due to a crash.
Have you tried an empty or simple web project to see if that works? One that we know has no other issues?[/quote]
Yes, a simple project was also failing.
In the meantime, I’ve rebuilt the packages (using aptitude): still error 500; then, I’ve issued a reboot command to restart the server. This worked! My applications are working the way they used to work!
Now, I’m concerned about the reliability of my server If I have to restart it every couple of months (as I already did for other reasons), I may not notice it soon enough. Does what I’ve had to do mean something is broken in my web server?