Osclass Support Forums

General osclass questions => General discussion => Topic started by: Sinto001 on December 12, 2020, 11:38:50 AM

Title: Add/Edit listing goes to HTTP ERROR 500 page - wrong mail server configuration
Post by: Sinto001 on December 12, 2020, 11:38:50 AM
I tried to update my listing as user and also tried to add new listing but both the time it on clicking update (on existing listing) or publish (on new listing). It leads to HTTP Error 500 page. In case of new listing it gets add in the listing but when the users publish it for first time it goes to HTTP Error page. Same for updating the existing listing.
When the page is reloaded users go to Recaptcha validation has failed message as shown in snapshot or goes to login page with other error messages like "listing update error 3" snapshot

How to avoid this HTTP Error 500 page redirection so users can go to proper account page and don't get logged out as it happens sometimes ?
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: MB Themes on December 12, 2020, 01:19:15 PM
Enable error log and you will also see details.
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: Sinto001 on December 12, 2020, 04:17:09 PM
Enable error log and you will also see details.

Which error log you intended. I found following in the options

define(OSC_DEBUG, true); - enable PHP debugging

define(OSC_DEBUG_LOG, true); - stores PHP debug into log file

define(OSC_DEBUG_DB, true); - enable DB debugging
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: Sinto001 on December 13, 2020, 09:11:22 AM
Please reply
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: officela on December 13, 2020, 07:48:32 PM
You need to place the lines below into config.php file located at the root of your installation.
This way you will see what is the reason of your error 500 sicne you will see the logs.

define(OSC_DEBUG, true);

define(OSC_DEBUG_LOG, true);

define(OSC_DEBUG_DB, true);



I had the same error and i solved it this way:  ( this does not mean you have the same issue but to know it you need see the error log )

Settings --> Mail Server - >Use POP before SMTP

uncheck this and tell me if it works now.
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: Sinto001 on December 13, 2020, 08:25:51 PM
You need to place the lines below into config.php file located at the root of your installation.
This way you will see what is the reason of your error 500 sicne you will see the logs.

define(OSC_DEBUG, true);

define(OSC_DEBUG_LOG, true);

define(OSC_DEBUG_DB, true);



I had the same error and i solved it this way:  ( this does not mean you have the same issue but to know it you need see the error log )

Settings --> Mail Server - >Use POP before SMTP

uncheck this and tell me if it works now.

Settings --> Mail Server - >Use POP before SMTP
is already unchecked
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: Sinto001 on December 14, 2020, 10:45:15 AM
I had turned on the debug as suggested by you but there is nothing displayed there. And the same redirection issue persists. Take look at the snapshots.
On submitting update or new listing first snapshot appears
On reloading page second snapshot appears and users gets logged out.
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: MB Themes on December 14, 2020, 10:51:18 AM
@Sinto001
This is proper code to enable debugging.
Code: [Select]
// Enable debugging
define('OSC_DEBUG', true);
define('OSC_DEBUG_DB', true);
define('OSC_DEBUG_LOG', true);
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: Sinto001 on December 14, 2020, 12:25:07 PM
I have added your code and tried updating a listing. Again I got the same issue, the page is redirected to HTTP Error 500 Page. Same thing I suppose happens when user adds a new listing. Why it is redirecting that is the problem but I can see the changes are updated or the listing is added. Issue is this redirection and user getting logged out. Admin also has same problem when they updates any listing or add a new one from their end.
The redirected link is myclassifiedxx.com/index.php

See 1st snapshot after new listing is added and/or a listing is modified or updated
See 2nd snapshot after page is reloaded, where  user is logged out with some error messages
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: MB Themes on December 14, 2020, 12:35:05 PM
@Sinto001
If error log is enabled, you should not have such error shown but you should see details. Consolut with your hosting provider.
You might have also output in oc-content/debug.log file in your hosting.
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: Sinto001 on December 14, 2020, 03:53:02 PM
Ok I will take their help but meanwhile can you see the debug file and suggest where is the issue coming from.
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: MB Themes on December 14, 2020, 03:54:38 PM
@Sinto001
[14-Dec-2020 20:20:39 Asia/Kolkata] PHP Fatal error:  Uncaught PHPMailer\PHPMailer\Exception: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting in /home/u794139114/public_html/classifieds/oc-includes/vendor/phpmailer/phpmailer/src/PHPMailer.php:1879

You should first test your mail server.
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: Sinto001 on December 14, 2020, 03:58:06 PM
@Sinto001
[14-Dec-2020 20:20:39 Asia/Kolkata] PHP Fatal error:  Uncaught PHPMailer\PHPMailer\Exception: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting in /home/u794139114/public_html/classifieds/oc-includes/vendor/phpmailer/phpmailer/src/PHPMailer.php:1879

You should first test your mail server.

I cannot understand what to do?
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: MB Themes on December 14, 2020, 03:59:41 PM
@Sinto001
First, properly configure and test your mail server.
Your hosting provider should be able to help with that.
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: Sinto001 on December 14, 2020, 04:17:34 PM
@Sinto001
First, properly configure and test your mail server.
Your hosting provider should be able to help with that.
What is this message in mail server options in Settings
Apache Module mod_ssl is not loaded
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: MB Themes on December 14, 2020, 05:15:22 PM
It is not important.
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: Sinto001 on December 15, 2020, 02:40:48 PM
I entered correct credentials in the Mail Server and now the redirection to HTTP Error 500 stopped.
Thanks for Support
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: MB Themes on December 15, 2020, 03:44:47 PM
@Sinto001
Nice to hear that ;)
Title: Re: Updating or Adding new Listing goes to HTTP ERROR 500 page
Post by: pipetko on January 03, 2021, 09:49:45 AM
@Sinto001
First, properly configure and test your mail server.
Your hosting provider should be able to help with that.
What is this message in mail server options in Settings
Apache Module mod_ssl is not loaded
do NOT use SSL connection, it wont work, its an old problem with OC
Title: Re: Add/Edit listing goes to HTTP ERROR 500 page - wrong mail server configuration
Post by: MB Themes on January 03, 2021, 03:01:42 PM
I would say it work for me. Many aspects depends on mail server.
Title: Re: Add/Edit listing goes to HTTP ERROR 500 page - wrong mail server configuration
Post by: pipetko on January 11, 2021, 12:26:51 AM
I would say it work for me. Many aspects depends on mail server.
I have worked on atleast 20 osclass based websites on clients, most of them on different hosting providers, worldwide.... I dont remember even one that didnt had problems with SSl emails.

P.S. Here is a feature request - It will be cool if the emails are working like worpdress php mailing without need of connecting any servers etc.
Title: Re: Add/Edit listing goes to HTTP ERROR 500 page - wrong mail server configuration
Post by: MB Themes on January 11, 2021, 08:34:52 AM
@pipetko
Well, emails are completely handled by PHP mailer library and currently, there is nothing better than PHP mailer library.
Title: Re: Add/Edit listing goes to HTTP ERROR 500 page - wrong mail server configuration
Post by: pipetko on January 12, 2021, 07:49:12 PM
@pipetko
Well, emails are completely handled by PHP mailer library and currently, there is nothing better than PHP mailer library.
That is true, but why it is not working without email settings / server set up?!
Havent tested in your version yet. But until Now from when I am using osclass, it never worked sending emails without set up email settings. Currently with one of the websites I maintance is with not set up email server and it is not sending emails. Only the Contact form of the website is working. User emails are somewhere, nowhere. later we set up Mail server and it is working with the propper settings ( no ssl offcorse, SSL never worked ). Now it is sending emails BUT here is another problem. Now the email server of the web hosting is blocking email by automated bot. I was labeled as spammy email because sending notifications of the users. They remove the mail and domain from the list but some days later it is again blocked. That is why I hate using email set up server. In wordress I never spammed my domains because using only php without connecting it to the provirder's mail servers I only receive messages there and no problem... Its a long storry but its a pain in the .... this with the mails. So now even with set up mail server the website is not sending most of the mails and the client made me to remove the account mail verification on user register. Later the owner changed the webhosting and there was the same problem.
Title: Re: Add/Edit listing goes to HTTP ERROR 500 page - wrong mail server configuration
Post by: MB Themes on January 13, 2021, 08:09:32 AM
@pipetko
Mails sent from PHP have almost 100% probability to be marked as spam.
Title: Re: Add/Edit listing goes to HTTP ERROR 500 page - wrong mail server configuration
Post by: pipetko on March 31, 2021, 09:20:55 PM
Agree... And still.... Why for example in Wordpress such a problem is a rare case ?!
Title: Re: Add/Edit listing goes to HTTP ERROR 500 page - wrong mail server configuration
Post by: MB Themes on April 01, 2021, 07:48:03 PM
All depends on what libraries use wordpress, but for me it sound weird that person that did not configured mail server complains why it does not work.