Jump to content

PHP webpage not working when hosted on VPS


Recommended Posts

Hi, all.

I've been trying to set up a VPS to use while Tommy is rebuilt.

One of my sites has a contacto.php page that shows a: "This page is not working. The page infantex.com.mx is unable to process this request. HTTP ERROR 500":

image.thumb.png.025a2fe15546bfbfc16d14bc142e9cfc.png

However, the same page, hosted by Tommy, partially works (it should show a Google map of the business location, I don't know when it started showing a blank rectangle instead).

Oops! It doesn't show anymore on Tommy. I guess Tommy is finally down. [EDIT: Now it shows again, Seems Tommy was not definitively down yet.]

I say: "it was working on Tommy" because a have another site: infantex.mx, which is an alias of the main one: infantex.com.mx (at least, I think that's how I set them up in Tommy's CPanel), and when I accessed the infantex.mx/contacto.php page, it showed, whilst infantex.com.mx/contacto.php resulted in the HTTP 500 ERROR shown above.

Any idea why I'm getting this error 500 with the page? I did not program the page, neither do I program in PHP, but I could take a look at it if you helped me with your suggestions.

In fact, the programming of the other pages may be substandard (or maybe just old). For example, the productos.php tried to generate thumbnails on the fly but the function that the programmer used stopped working a while ago and I just added hard-coded thumbnails (I guess Tommy's PHP version was updated?). Anyways, the script was creating a LOT of temporary files!

I appreciate your help, specially with the non-working contacto.php page.

Regards,

 

 

Link to comment
Share on other sites

Error 500 seems to indicate, that there is an error in the PHP script. I think, that you can find details when having a look at the Apache error log. My PHP scripts work all fine, including access to MariaDB, all this without that I had to do anything at all (config by Hestia). Your error may be caused by a difference between the PHP, the script is intended for (maybe v5), and the PHP version, that you are actually using on your VPS; I think it's version 7.4; you can change this in the config of your PHP server.

Link to comment
Share on other sites

Thanks for your suggestion.

Did that. PHP is working and the installed version is 7.4.21 (https://infantex.com.mx/info.php).

I didn't really have doubts that PHP was working, all the pages are PHP files and only that one file is not working.

But, with your suggestion, I used FTP to upload the info.php file to the mirror site hosted (still) by Tommy, and found out it's running PHP 5.4.45 (https://infantex.mx/info.php), which makes sense since this site was written in 2010, with only minor updates (that involved copying, pasting and modifying the code for the products page, when adding new products, or commenting them out when some were discontinued --- At some point I added a HotJar reference, and minor stuff like that).

I didn't see an obvious way in Hestia to change the PHP version. Surely, when Tommy was upgraded to a newer PHP version years ago (?), I  must have downgraded the version. I guess cPanel had a more obvious way to do that. I took a look in Hestia's manual, but the GUI section is seriously lacking. 

Up to now, I've been doing everything in the GUI. Do you know if I can use command-line instructions (there should be one to change PHP version) or would that conflict with the GUI's settings)? Zero experience with Linux here!

I've had very little time to work on this, I'm kind of a one-man-orchestra when it comes to management of the business and I've been mostly engaged with end-of-month accounting stuff this week. 😬

Regards,

Link to comment
Share on other sites

4 hours ago, infantex said:

But, with your suggestion, I used FTP to upload the info.php file to the mirror site hosted (still) by Tommy, and found out it's running PHP 5.4.45 (https://infantex.mx/info.php),

That's strange. This version is not currently available in the distribution package. That is, it should not refer to the VPS.

I looked at infantex.mx:

$ dig infantex.mx

; ANSWER SECTION:
infantex.mx.            14400   IN      A       65.19.143.6

It still refers to Tommy. You haven't switched name servers yet.

Link to comment
Share on other sites

6 hours ago, infantex said:

I didn't see an obvious way in Hestia to change the PHP version. Surely, when Tommy was upgraded to a newer PHP version years ago (?), I  must have downgraded the version. I guess cPanel had a more obvious way to do that. I took a look in Hestia's manual, but the GUI section is seriously lacking. 

Assuming we're talking about the same panel (HestiaCP), and that their demo is not outdated, I poked around in it's demo and was able to find out that you can change the PHP version by editing the server (going to the server by the gear icon, then configure / alternatively the URL should be https://panelurl:port/edit/server/, for the demo it was https://demo.hestiacp.com:8083/edit/server/), clicking the "web server" section, and it should show the installed PHP versions , should look something like this:

image.png.b89b769e0808b1b05dda0eeb37342fe8.png

If there isn't such an option, or I got the wrong panel, I'm sorry.

It doesn't seem to have the version you want (at least the demo, no idea how your server is configured and if you're able to change that from there), but you could try 5.6 and see if it works.

----------------

1 hour ago, balloons said:

That's strange. This version is not currently available in the distribution package. That is, it should not refer to the VPS.

I looked at infantex.mx:

$ dig infantex.mx

; ANSWER SECTION:
infantex.mx.            14400   IN      A       65.19.143.6

It still refers to Tommy. You haven't switched name servers yet.

I think you may be a little confused, understandably so as I was a bit confused too. infantex.mx pointing to Tommy, while infantex.com.mx points to the new VPS, seems to be the intended behavior. From what I've understood by what infantex said here, the first domain is set to still point to Tommy to help indentifying the problem, while the second (as the main site?) is pointing to the VPS. Quoting:

6 hours ago, infantex said:

referring to .com.mx site

I've been trying to set up a VPS to use while Tommy is rebuilt.

One of my sites has a contacto.php (note: site:infantex.com.mx) page that shows a: "This page is not working. The page infantex.com.mx is unable to process this request. HTTP ERROR 500":..

... Did that. PHP is working and the installed version is 7.4.21 (https://infantex.com.mx/info.php). (note by commenter: this is the site pointing to the VPS, which has also been linked as the main site initially)

referring to .mx site

However, the same page, hosted by Tommy, (note: site:infantex.mx) partially works

But, with your suggestion, I used FTP to upload the info.php file to the mirror site hosted (still) by Tommy, and found out it's running PHP 5.4.45 (https://infantex.mx/info.php),

I fear my "explanation" might be more complicated than the initial messages, and @infantex please correct me if I understood it wrong.

Link to comment
Share on other sites

Thanks for your help, @pctips.

I now understand (kind of) that I was trying to set the PHP options for the domain, and I only had a "default" PHP template availabe for that). With your help, I was able to enable PHP 5.6 on the server and, afterwards, select a PHP 5.6 template for the domain. Voilá! The contacto.php web page is now working, including the mini map!

Clarification for you and @balloons regarding the domains:

infantex.com.mx is the main, original site. It's just a static website that was hosted on Tommy (and previously on Ricky, and before that on Johnny, I don't remember). Mail for this domain is handled by Google Apps (now Google Worskspace?).

A couple of years ago, I secured the infantex.mx domain name, and the only thing I did was to set it as an alias to infantex.com.mx in Tommy's cPanel (I think). I never got to adding emails, etc.

I moved the domain infantex.com.mx to the VPS. I didn't do anything with infantex.mx, so I guess that's why it's still on Tommy (which means I don't really understand how aliases work) or because the Registrar's records for infantex.mx still points to heliohost.org's nameservers.

So, yes: infantex.com.mx is on the VPS and infantex.mx is on Tommy (I guess this turned out to be kind of fortunate).

Additionally, I have the zaldivar.mx domain that I only use for email (so that the family can have emails with our surname 🙂). No website for this domain. Mail for this domain was serviced by Tommy (I still haven't been able to set the email for this domain correctly, I correct one thing and another stops working 😬).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...