Link to home
Start Free TrialLog in
Avatar of ITPro44
ITPro44Flag for United States of America

asked on

Machform PHP Errors

We recently upgraded our GoDaddy hosting platform to cPanel. We are now getting some errors on a form we have on our website. Our web developer is unable to assist at this time and I need to figure out how to fix these problems on my own. I've tried going into the php files and looking at the code on each line, but can't make sense of what needs to be changed. Can anyone help me figure this out? Below are the error we get when submitting the form.

Warning: date_default_timezone_set() expects exactly 1 parameter, 2 given in /home/business/public_html/machform/includes/entry-functions.php on line 336

Deprecated: Function eregi() is deprecated in/home/business/public_html/machform/lib/class.phpmailer.phpon line 591

Warning: fsockopen(): unable to connect to relay-hosting.secureserver.net:25 (No route to host) in/home/business/public_html/machform/lib/class.smtp.php on line 122
Error sending email: SMTP Error: Could not connect to SMTP host.
Warning: date_default_timezone_set() expects exactly 1 parameter, 2 given in /home/business/public_html/machform/includes/entry-functions.php on line 336

Deprecated: Function eregi() is deprecated in/home/business/public_html/machform/lib/class.phpmailer.phpon line 591

Warning: fsockopen(): unable to connect to relay-hosting.secureserver.net:25 (No route to host) in/home/business/public_html/machform/lib/class.smtp.php on line 122
Error sending email: SMTP Error: Could not connect to SMTP host.
Warning: Cannot modify header information - headers already sent by (output started at /home/business/public_html/machform/includes/entry-functions.php:336) in/home/business/public_html/machform/embed.php on line 42
Avatar of Marco Gasi
Marco Gasi
Flag of Spain image

The first error is what it say to be: the function date_default_timezone_set() expects 1 parameter and in your code is called passing it 2 parameters. Since Php 5.1.0 this function has been rewritten so maybe it required two parameters in older versions of Php (you can read about here http://www.php.net/manual/en/function.date-default-timezone-set.php)

The functions ereg() and eregi() are deprectaed: now you have to use preg_match or preg_match_all

fsockopen and email errors probably refer to server settings and you should tell about to GoDaddy (I heared no good things about this provider but I don't have a direct experience)

Summarizing, I fear your code is outdated and probably there are several parts of it which need to be rewritten. I'm sorry, but I don't think this can be done so quickly and easily as you wish.

Best of luck
Marco
For the error Warning: date_default_timezone_set()
Go into your php.ini and set your timezone locale
http://php.net/manual/en/timezones.php

For the error Warning: fsockopen(): unable to connect to relay-hosting.secureserver.net
GoDaddy uses a relay hosting so you will need to go to your mailer code and set the username/password and make sure the From field is using an address from your domain
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
see more errors after you fix these
Very probably...
If you know what the old version was and it is still installed you can revert back to it.
http://www.siteground.com/tutorials/cpanel/php_version_change.htm
Godaddy has been trying to get all their clients to upgrade PHP to version 5.3.  They still had people on PHP 4.4.  I got one job last year because the client was 'automatically' upgraded from 4.4 to 5.3 and everything stopped working.  The farthest back Godaddy would go was PHP 5.2.  They wouldn't let them go back to PHP 4.4.
Avatar of ITPro44

ASKER

OK, so I'm not attempting to upgrade the machform as it appeared the PHP was outdated.  When attempting the upgrade I get the following error:

Fatal error: Class 'PDO' not found in /home/business/public_html/machform/includes/db-core.php on line 12

Any ideas?
In php.ini again, look for
extension=pdo.so
extension=pdo_mysql.so


And remove the # from the beginning of the lines, if they don't exist then add them
Restart Apache
Avatar of ITPro44

ASKER

This is what our php.ini fiel loks like.  How should I modify it?  And how do I restart Apache?

Set session.auto_start = 1
Set register_globals = 0
allow_url_fopen = on
date.timezone = "US/Pacific"

expose_php = Off
max_input_time = 600000
variables_order = "EGPCS"
extension_dir = ./
upload_tmp_dir = /tmp
precision = 12
SMTP = localhost.secureserver.net
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
upload_max_filesize = 700M
[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.5.7
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.5.7
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so                                                                  
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so                                                            
session.bug_compat_42
post_max_size = 700M
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ITPro44

ASKER

I got PDO working, thanks!  I'm now awaiting Machform support to respond to me with instructions on how to reset the admin password as the password info changed during the upgrade.  I'm hoping that will be the last of it.  We'll see...
If you want help converting patterns for ereg* calls to preg* then you'll get an excellent response if you post to the Regular Expressions topic area.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ITPro44

ASKER

thanks!