Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 

News:



Author Topic: PHP script errors  (Read 2939 times)

Mobilepro

  • **
  • Posts: 43
    • View Profile
    • Email
PHP script errors
« on: July 14, 2010, 11:48:11 AM »
First let me say that moving to Arvixe was the best decision I could have made...it's been beyond my expectation.
 
Having said that...I could really use some help getting some PHP scripts to run and am trying to decipher whether the problem is with the script or on the server.

My hosting package is Windows and the CMS application is called Instant Update.

I have verified that all the required files have been uploaded correctly to the server under wwwroot.  If I add in a simple script line into index.php:
 <?php
define('BASE_PATH','./');
include BASE_PATH . 'manage/functions.php';
?>

I get the following error:
Warning: include(./manage/functions.php) [function.include]: failed to open stream: No such file or directory in C:\HostingSpaces\xxx\xxxxxx.com\wwwroot\index.php on line 3

Warning: include(./manage/functions.php) [function.include]: failed to open stream: No such file or directory in C:\HostingSpaces\xxx\xxxxx.com\wwwroot\index.php on line 3

Warning: include() [function.include]: Failed opening './manage/functions.php' for inclusion (include_path='.;C:\php5\pear') in C:\HostingSpaces\xxx\xxxxxx.com\wwwroot\index.php on line 3:

The file functions.php does exist in the "manage" folder under the root. When I run functions.php it parses the file but generates the same type of error on multiple lines in the file so it does look like it is finding the files.

Requirements for the application are:
■1 MySQL database
■PHP 4 or PHP 5
■register_globals turned OFF
■proper session handling
■5 MB free web space for scripts
■■mod_rewrite (optional)

Interestingly the application control panel works just fine and it's in the same folder.

Any thoughts would be greatly appreciated.

Steve H

Re: PHP script errors
« Reply #1 on: July 14, 2010, 11:56:39 AM »
Hi Mobilepro,

On our Window servers PHP is located at C:\PHP5\php.exe, so when you use BASE_PATH you're actually getting C:\PHP5.  A quick fix that I can recommend is replacing your relative paths with the fully qualified path to your files.

For example, take this code

Code: [Select]
<?php
define
('BASE_PATH','./');
include 
BASE_PATH 'manage/functions.php';
?>


and replace it with something like this

Code: [Select]
<?php
define
('C:/HostingSpaces/user/domain.com/wwwroot/path/to/application');
include(
'C:/HostingSpaces/user/domain.com/wwwroot/path/to/application/manage/functions.php');
?>


Hope this helps, let us know if you need anything else.

Arvand

  • Operations Manager
  • *****
  • Posts: 5759
    • View Profile
    • http://www.arvixe.com
Re: PHP script errors
« Reply #2 on: July 14, 2010, 12:00:48 PM »
Another option is to ask a staff member to set your PHP to run as CGI. This will slow down php but will fix your issue.
Arvand Sabetian
Operations Manager
arvand.sabetian@arvixe.com
1-888-927-8493 [Ext.861]

Shai

  • **
  • Posts: 214
    • View Profile
Re: PHP script errors
« Reply #3 on: July 14, 2010, 12:08:11 PM »
And this is what works for me:

Quote from: vars.php
<?php
$color = 'green';
$fruit = 'apple';
?>

Quote from: index.php
<?php
define('BASE_PATH','c:/hostingspaces/xxx/xxxxxx.com/wwwroot/');
include BASE_PATH . 'inc/vars.php';
echo "A $color $fruit"; // A green apple
?>

Result and expected output:
Quote
A green apple

Mobilepro

  • **
  • Posts: 43
    • View Profile
    • Email
Re: PHP script errors
« Reply #4 on: July 14, 2010, 12:18:09 PM »
I'm blown away by the fast response and help with this...defining BASE_PATH with the full path instead of relative did the trick.

Thanks to all!

Shai

  • **
  • Posts: 214
    • View Profile
Re: PHP script errors
« Reply #5 on: July 14, 2010, 12:20:08 PM »
People on this forum aim to please :)

Shai

  • **
  • Posts: 214
    • View Profile
Re: PHP script errors
« Reply #6 on: July 14, 2010, 12:20:47 PM »

RyanArvixe

  • Lead Server Manager
  • *****
  • Posts: 3413
    • View Profile
    • Arvixe, LLC
    • Email
Re: PHP script errors
« Reply #7 on: July 14, 2010, 07:44:51 PM »
Glad we was able to get things running for you. As Shai said, we do aim to please here at Arvixe  :)
Ryan Chaffin
Lead Server Manager
ryan.chaffin@arvixe.com
1-888-927-8493

 

Web Hosting

Linux Hosting
ASP .NET Hosting
Business Hosting
Reseller Hosting
E-Commerce Hosting
Dedicated Servers

Acceptable Use Policy
Terms of Service
Privacy Policy

Affiliate Program
Site Map

Blog Hosting

PostNuke Hosting
WordPress Hosting
b2evolution Hosting
Textpattern Hosting
Habari Hosting


CMS Hosting

CMS Made Simple Hosting
phpNuke Hosting
Geeklog Hosting
phpWCMS Hosting
phpWebSite Hosting
Shopping Cart Hosting

OpenCart Hosting
osCommerce Hosting
CubeCart Hosting
Buy Safe Hosting
Zen Cart Hosting


Video Sharing Software Hosting

iVidPlay Hosting
ClipBucket Hosting
ClipShare Hosting
osTube Hosting
vShare Hosting
Forum Hosting

XMB eXtreme Hosting
phpBB Hosting
Simple Machines Hosting
Vanilla Forum Hosting
AEF Hosting


Social Network and Community Website Hosting

SocialEngine Hosting
Jcow Hosting
Skadate Hosting
Dolphin Hosting
Elgg Hosting
Copyright © 2003-2013 Arvixe, LLC. All trademarks are property of their legal owner.