Solved

Machform PHP Errors

Posted on 2014-01-17
14
1,198 Views
Last Modified: 2014-01-28
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
0
Comment
Question by:ITPro44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 2
  • +2
14 Comments
 
LVL 31

Expert Comment

by:Marco Gasi
ID: 39789247
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
0
 
LVL 58

Expert Comment

by:Gary
ID: 39789256
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
0
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 250 total points
ID: 39789268
Your version of PHP has been upgraded in the change to PHP 5.3 I believe.  You will have to get your programmer involved because I think you will probably see more errors after you fix these.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 58

Expert Comment

by:Gary
ID: 39789278
see more errors after you fix these
Very probably...
0
 
LVL 58

Expert Comment

by:Gary
ID: 39789301
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
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39789368
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.
0
 

Author Comment

by:ITPro44
ID: 39789552
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?
0
 
LVL 58

Expert Comment

by:Gary
ID: 39789567
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
0
 

Author Comment

by:ITPro44
ID: 39789587
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
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 250 total points
ID: 39789600
Just add those two lines to the end of the file and save
To restart goto Restart Services menu and select HTTPD
http://docs.cpanel.net/twiki/bin/view/11_30/WHMDocs/RestartServices

You can enable PDO thru easyApache, exhaustive options
http://docs.cpanel.net/twiki/bin/view/EasyApache/WebHome
0
 

Author Comment

by:ITPro44
ID: 39789931
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...
0
 
LVL 35

Expert Comment

by:Terry Woods
ID: 39792789
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.
0
 

Accepted Solution

by:
ITPro44 earned 0 total points
ID: 39805008
Upgrading machform resolved the problem.  Thanks everyone for your help!
0
 

Author Closing Comment

by:ITPro44
ID: 39814566
thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime is disastrous for companies and can lead to major hits on a brand, reputation, an…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question