Solved

Machform PHP Errors

Posted on 2014-01-17
14
1,168 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
  • 5
  • 5
  • 2
  • +2
14 Comments
 
LVL 30

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 82

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
 
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 82

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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Read about why website design really matters in today's demanding market.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now