SitePoint Sponsor |
|
User Tag List
Results 1 to 10 of 10
Thread: starnge require() problem
-
Jan 23, 2009, 03:53 #1
- Join Date
- Nov 2004
- Location
- Lytham
- Posts
- 163
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
starnge require() problem
I am moving an osCommerce shop to one of my servers from another one. Both use PHP 4.x.
On the checkout page there is the following code:
Code:require (DIR_WS_CLASSES . 'payment.php');
Warning: main(1) [function.main]: failed to open stream: No such file or directory in xxx/xxx/httpdocs/shop/checkout_confirmation.php on line 48
Fatal error: main() [function.require]: Failed opening required '1' (include_path='.:/usr/lib/php') in xxx/xxx/httpdocs/shop/checkout_confirmation.php on line 48
The other puzzle is the 1 in main(1) and Failed opening required '1'
does anyone have any ideas?
-
Jan 23, 2009, 04:00 #2
- Join Date
- Oct 2008
- Location
- London
- Posts
- 862
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Looks like TRUE is passed as a parameter to the require() function. Show some code, specifically line 48 from checkout_confirmation.php.
Pawel Decowski (you should follow me on Twitter)
-
Jan 23, 2009, 04:04 #3
- Join Date
- Nov 2004
- Location
- Lytham
- Posts
- 163
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
line 48 is the require() line
-
Jan 23, 2009, 04:13 #4
- Join Date
- Oct 2008
- Location
- London
- Posts
- 862
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Quote some more code around line 48.
Pawel Decowski (you should follow me on Twitter)
-
Jan 23, 2009, 04:20 #5
- Join Date
- Oct 2006
- Location
- Kathmandu, Nepal
- Posts
- 4,013
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Post more codes around the error. Try echoing DIR_WS_CLASSES too..
Mistakes are proof that you are trying.....
------------------------------------------------------------------------
PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5
-
Jan 23, 2009, 04:20 #6
- Join Date
- Nov 2004
- Location
- Lytham
- Posts
- 163
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
immediately before this is:
Code:require('includes/application_top.php'); // if the customer is not logged on, redirect them to the login page if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT)); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } // if there is nothing in the customers basket, redirect them to the shopping basket page if ($basket->count_contents() < 1) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } // avoid hack attempts during the checkout procedure by checking the internal basketID if (isset($basket->basketID) && tep_session_is_registered('basketID')) { if ($basket->basketID != $basketID) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } } // if no shipping method has been selected, redirect the customer to the shipping method selection page if (!tep_session_is_registered('shipping')) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } if (!tep_session_is_registered('payment')) tep_session_register('payment'); if (isset($HTTP_POST_VARS['payment'])) $payment = $HTTP_POST_VARS['payment']; if (!tep_session_is_registered('comments')) tep_session_register('comments'); if (tep_not_null($HTTP_POST_VARS['comments'])) { $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); }
-
Jan 23, 2009, 04:24 #7
- Join Date
- Oct 2008
- Location
- London
- Posts
- 862
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Please post code around line 48, including the line. Not code before or after. Also if you use php tags rather than code, it'll be much easier to read.
Thanks.Pawel Decowski (you should follow me on Twitter)
-
Jan 23, 2009, 04:53 #8
- Join Date
- Nov 2004
- Location
- Lytham
- Posts
- 163
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
PHP Code:// load the selected payment module
require (DIR_WS_CLASSES . 'payment.php') or die();
if ($credit_covers) $payment=''; //ICW added for CREDIT CLASS
$payment_modules = new payment($payment);
-
Jan 23, 2009, 05:15 #9
- Join Date
- Oct 2008
- Location
- London
- Posts
- 862
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This isn't going to work:
PHP Code:require (DIR_WS_CLASSES . 'payment.php') or die();
PHP Code:(DIR_WS_CLASSES . 'payment.php') or die()
Anyway, the solution:
PHP Code:require (DIR_WS_CLASSES . 'payment.php');
Pawel Decowski (you should follow me on Twitter)
-
Jan 23, 2009, 05:26 #10
- Join Date
- Nov 2004
- Location
- Lytham
- Posts
- 163
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
OK thats great, thanks
Bookmarks