New install code problem

Please post all install related problems here. Visit this forum first for troubleshooting.
User avatar
bowyersden
Posts: 16
Joined: Thu 19. Mar 2009, 19:03
Location: Western Maryland

New install code problem

Post by bowyersden »

index,php diplays this code
Warning: main(config/phpwcms/conf.inc.php) [function.main]: failed to open stream: No such file or directory in d:\hshome\server\my-site.com\index.php on line 35

Fatal error: main() [function.require]: Failed opening required 'config/phpwcms/conf.inc.php' (include_path='.;c:\PHP\pear') in d:\hshome\server\my-site.com\index.php on line 35
Here is line 35 on index.php

Code: Select all

// load general configuration
require_once 'config/phpwcms/conf.inc.php';   <--- Line 35
require_once 'include/inc_lib/default.inc.php';
require_once PHPWCMS_ROOT.'/include/inc_lib/dbcon.inc.php';
i did not delete the setup folder until I was sure it's working.
nebenaube
Posts: 139
Joined: Fri 23. Nov 2007, 20:39
Location: Redlands, CA
Contact:

Re: New install code problem

Post by nebenaube »

The last step in the setup is to download the setup.config.inc.php, (from the setup folder), rename it and move it to /config/phpwcms/config.inc.php
User avatar
bowyersden
Posts: 16
Joined: Thu 19. Mar 2009, 19:03
Location: Western Maryland

Re: New install code problem

Post by bowyersden »

OK, did that and now got this on index.php trying to load.
Warning: main(/include/inc_lib/permissions.class.php) [function.main]: failed to open stream: No such file or directory in d:\hshome\server\my-site.com\include\inc_lib\default.inc.php on line 212

Warning: main(/include/inc_lib/permissions.class.php) [function.main]: failed to open stream: No such file or directory in d:\hshome\server\my-site.com\include\inc_lib\default.inc.php on line 212

Fatal error: main() [function.require]: Failed opening required '/include/inc_lib/permissions.class.php' (include_path='.;c:\PHP\pear') in d:\hshome\server\my-site.com\include\inc_lib\default.inc.php on line 212
I looked for the install direction in the download or a read me file. Maybe that should be included. Do I still leave the setup folder intact or delete it. Is that the problem?
User avatar
bowyersden
Posts: 16
Joined: Thu 19. Mar 2009, 19:03
Location: Western Maryland

Re: New install code problem

Post by bowyersden »

Line 212 says

Code: Select all

require(PHPWCMS_ROOT.'/include/inc_lib/permissions.class.php');
nebenaube
Posts: 139
Joined: Fri 23. Nov 2007, 20:39
Location: Redlands, CA
Contact:

Re: New install code problem

Post by nebenaube »

That sounds like a path error.

In conf.inc.php:

Code: Select all

$phpwcms["site"]              = "http://".$_SERVER['SERVER_NAME']."/";
$phpwcms['DOC_ROOT']    = $_SERVER['DOCUMENT_ROOT'];// real DOC_ROOT seems to be: d:\hshome\server\my-site.com
$phpwcms['root']  = ''; 
User avatar
bowyersden
Posts: 16
Joined: Thu 19. Mar 2009, 19:03
Location: Western Maryland

Re: New install code problem

Post by bowyersden »

i deleted my admin name and password.

Is the root wrong? It looks blank.

Code: Select all

// site values
$phpwcms['site']              = 'http://www.bowyers-den.com/';
$phpwcms['admin_name']        = '----------'; //default: Webmaster
$phpwcms['admin_user']        = '----------'; //default: admin
$phpwcms['admin_pass']        = '---------------------------'; //--(phpwcms)
$phpwcms['admin_email']       = '----------------@bowyers-den.com'; //default: noreplay@host

// paths
$phpwcms['DOC_ROOT']          = $_SERVER['DOCUMENT_ROOT'];// real DOC_ROOT seems to be: 'd:/hshome/madduck/bowyers-den.com/inc' 
$phpwcms['root']         		= '';         //default: ''
$phpwcms['file_path']         = 'filearchive';    //default: 'filearchive'
$phpwcms['templates']         = 'template';    //default: 'template'
$phpwcms['content_path']      = 'content'; //default: 'content'
$phpwcms['cimage_path']       = 'images';  //default: 'images'
$phpwcms['ftp_path']          = 'upload';     //default: 'upload'
nebenaube
Posts: 139
Joined: Fri 23. Nov 2007, 20:39
Location: Redlands, CA
Contact:

Re: New install code problem

Post by nebenaube »

no that's correct and don't sweat it. I've had this problem too. The php function fopen is failing. Make sure the permission class is present and that the webserver can read it. I take it this is on windows... is this running with IIS or apache? The paths depend on the value in $phpwcms['DOC_ROOT'] so perhaps you could insert a bit of debugging code in default.inc.php on line 211 to read the value being used...

Code: Select all

// load permissions class
dumpVar('DOC_ROOT: '.$phpwcms['DOC_ROOT']);  << INSERTED DEBUG CODE
require(PHPWCMS_ROOT.'/include/inc_lib/permissions.class.php');
The constant PHPWCMS_ROOT is defined higher up in the file on line 112 and should look like:

Code: Select all

define ('PHPWCMS_ROOT', 			$phpwcms['DOC_ROOT']);
You might want to double check the webserver configuration (httpd.conf) on apache and insure that the site's document root is correct.

on edit: the permissions.class.php appears to be readable by your server so best to chase down the value thats making it into $phpwcms['DOC_ROOT'] and find out why it isn't initializing to the root path of your website.
User avatar
bowyersden
Posts: 16
Joined: Thu 19. Mar 2009, 19:03
Location: Western Maryland

Re: New install code problem

Post by bowyersden »

nebenaube wrote: I take it this is on windows... is this running with IIS or apache? The paths depend on the value in $phpwcms['DOC_ROOT'] so perhaps you could insert a bit of debugging code in default.inc.php on line 211 to read the value being used...

Code: Select all

// load permissions class
dumpVar('DOC_ROOT: '.$phpwcms['DOC_ROOT']);  << INSERTED DEBUG CODE
require(PHPWCMS_ROOT.'/include/inc_lib/permissions.class.php');
The constant PHPWCMS_ROOT is defined higher up in the file on line 112 and should look like:

Code: Select all

define ('PHPWCMS_ROOT', 			$phpwcms['DOC_ROOT']);
You might want to double check the webserver configuration (httpd.conf) on apache and insure that the site's document root is correct.

on edit: the permissions.class.php appears to be readable by your server so best to chase down the value thats making it into $phpwcms['DOC_ROOT'] and find out why it isn't initializing to the root path of your website.
OK, it's windows based server. Don't know about ISS or apache.

Default.inc.php under includes does not have load permission class but apears to be blank on the root.

Code: Select all

// important to script that must know the real path to files or something else

$phpwcms['DOC_ROOT'] = rtrim( str_replace("\\", '/', $phpwcms['DOC_ROOT']), '/' );
if( empty($phpwcms["root"]) ) {
	$phpwcms["root"]			 = '';
	$phpwcms["host_root"]		 = '';
} else {
	$phpwcms["root"]			 = trim( $phpwcms["root"], '/' );
	$phpwcms["host_root"]		 = '/'.$phpwcms["root"];
	$phpwcms['DOC_ROOT']		.= 	'/' . $phpwcms["root"];
	$phpwcms["root"]			.= 	'/';
}

define ("PHPWCMS_ROOT", 			$phpwcms['DOC_ROOT']);
define ('PHPWCMS_FILES', 			$phpwcms["file_path"] . '/');
define ('PHPWCMS_BASEPATH',			'/' . $phpwcms["root"]);
define ('On',						true);
define ('Off',						false);
define ('PHPWCMS_USER_KEY',			md5(getRemoteIP().$phpwcms['DOC_ROOT'].$phpwcms["db_pass"]));
define ('PHPWCMS_REWRITE_EXT',		'phtml');

$phpwcms['browser_detect']		=	phpwcms_getUserAgent();
define('BROWSER_NAME',				$phpwcms['browser_detect']['agent']);
define('BROWSER_NUMBER',			$phpwcms['browser_detect']['version']);
define('BROWSER_OS',				$phpwcms['browser_detect']['platform']);

$phpwcms["file_path"]    		= 	'/'.$phpwcms["file_path"].'/' ;  // "/phpwcms_filestorage/"

define ('TEMPLATE_PATH', 			$phpwcms["templates"].'/');
$phpwcms["templates"]    		= 	'/'.$phpwcms["templates"].'/' ;  // "/phpwcms_template/"
$phpwcms["content_path"] 		= 	$phpwcms["content_path"].'/'  ;  // "content/"
define ('CONTENT_PATH',				$phpwcms["content_path"]);
$phpwcms["cimage_path"]  		= 	$phpwcms["cimage_path"].'/'   ;  // "images/"
$phpwcms["ftp_path"]     		= 	'/'.$phpwcms["ftp_path"].'/'  ;  // "/phpwcms_ftp/"

define ('PHPWCMS_TEMPLATE', 		PHPWCMS_ROOT.$phpwcms["templates"]);
define ('PHPWCMS_URL', 				$phpwcms["site"].$phpwcms["root"]);

$phpwcms['parse_url']			=	parse_url(PHPWCMS_URL);
define ('PHPWCMS_HOST',				$phpwcms['parse_url']['host'].$phpwcms["host_root"]);
define ('PHPWCMS_IMAGES', 			$phpwcms["content_path"].$phpwcms["cimage_path"]);
define ('PHPWCMS_TEMP', 			PHPWCMS_ROOT.'/'.$phpwcms["content_path"].'tmp/');
define ('PHPWCMS_CONTENT',			PHPWCMS_ROOT.'/'.$phpwcms["content_path"]);
define ('PHPWCMS_THUMB',			PHPWCMS_CONTENT.$phpwcms["cimage_path"]);
define ('PHPWCMS_RSS', 				PHPWCMS_CONTENT.'rss');
define ('LF', 						"\n"); 	//global new line Feed

define ('MB_SAFE',					function_exists('mb_substr') ? true : false); //mbstring safe - better to do a check here

$phpwcms['modules']				 = array();
$phpwcms['modules_fe_render']	 = array();
$phpwcms['modules_fe_init']		 = array();
Not sure how to check the server on my control panel.
nebenaube
Posts: 139
Joined: Fri 23. Nov 2007, 20:39
Location: Redlands, CA
Contact:

Re: New install code problem

Post by nebenaube »

Ok, I downloaded the r307 zip file and unpacked it. The problem appears to be that the file /include/inc_lib/default.inc.php has unix line breaks. Use an ftp client like file zilla or ws-ftp, download the default.inc.php from your server as ascii and upload it back to the server as ascii and then see if that works... (if you view the file in notepad after unpacking the zip; it appears to be all jammed into 21 lines of code - it won't work that way)

note: one could also open this file with say programmer's notepad or VC6's IDE and then save it and upload as ascii.
User avatar
Oliver Georgi
Site Admin
Posts: 9889
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: New install code problem

Post by Oliver Georgi »

Always upload in BINARY mode! Never ASCII! Use better FTP client. Re-upload original file in BINARY mode. Also use an UNZIP application that does no line break conversion.

So your tip is NOT recommend.

And also STOP posting same problem in several threads.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
bowyersden
Posts: 16
Joined: Thu 19. Mar 2009, 19:03
Location: Western Maryland

Re: New install code problem

Post by bowyersden »

I have just been using Windows Extraction Wizard, which extraction program should I get? Is WinZip fine? What do you all recommend?

I edit the files with Microsoft Visual Basic and it opens the files with the line numbers. But yes, Notepad has them all bunched up and I can not read the code like that.

I am using Core for my FTP program. Under Options/extensions/ASCii button: it has a list of file extension to load in ACSII and php is listed in there. It also has an ignore check box next to the button. I am guessing I can check the box and it will switch to binary, but it does not spelling anything out that clear. I read up on Core and it says if it's listed in there it uploads as ASCii. so right now php, htm and html upload a ASCii. I can delete them from the list so they go in Binary with the WAV and JPG's. And other files extensions that I should add to the removal list?

What do you all recommend?
User avatar
Oliver Georgi
Site Admin
Posts: 9889
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: New install code problem

Post by Oliver Georgi »

Yes, you should never upload as ASCII. That's crap in these days.

Use 7-zip. It's free and good.

Never use Notepad to edit any file!!! It's crap because it always saves any file with BOM in UTF-8 format. This will destroy your PHP files and can result in frontend errors. Use the free PSPad instead.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
nebenaube
Posts: 139
Joined: Fri 23. Nov 2007, 20:39
Location: Redlands, CA
Contact:

Re: New install code problem

Post by nebenaube »

from: http://en.wikipedia.org/wiki/UTF-8
Byte-order mark

Many Windows programs (including Windows Notepad) add the bytes 0xEF,0xBB,0xBF at the start of any document saved as UTF-8. This is the UTF-8 encoding of the Unicode byte-order mark. This causes interoperability problems with software that does not expect the BOM. In particular:

* It removes the desirable feature that UTF-8 is identical to ASCII for ASCII-only text. For instance a text editor that does not recognize UTF-8 will display "" at the start of the document, even if the UTF-8 contains only ASCII and would otherwise display correctly. It is for example possible to introduce Unicode into an existing computer language and compiler by adding some API for input/output, and use an external UTF-8 text editor when editing text strings. However such a compiler would not accept the BOM, which must be removed manually.
* Programs that identify file types by special leading characters will fail to identify the UTF-8 files, even for file types that can otherwise contain UTF-8. A notable example is the Unix shebang syntax.

Some Windows software (including Notepad) will sometimes misidentify UTF-8 (and thus plain ASCII) documents as UTF-16LE if this BOM is missing, a bug commonly known as "Bush hid the facts" after a particular phrase that can trigger it.
I stand corrected. UTF-8 is new to me since I don't tend to code for multi-lingual sites. That doesn't change the fact that the file in question's encoding is different than in the rest of the system in the r307 release.

As far a posting in several topics, no problem. I'm done attempting to contribute.
User avatar
bowyersden
Posts: 16
Joined: Thu 19. Mar 2009, 19:03
Location: Western Maryland

Re: New install code problem

Post by bowyersden »

I keep trying to reload the include folder now in binary. I get to this:
nclude/inc_ext/fckeditor/editor/images/smiley/msn/thumbs_up.gif

and the ftp crashes. "The system failed to find specified file"

three times in a row. Any ideas? i was going folder by folder and doing a re-upload now with a new un zipped files and FTP client with new binary settings. It crashes at this same file every time
User avatar
Oliver Georgi
Site Admin
Posts: 9889
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: New install code problem

Post by Oliver Georgi »

clean remote before re-uploading.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Post Reply