Forums / Installing on a Linux/Unix Server / Error encountered while writing /includes/configure.php

Error encountered while writing /includes/configure.php

Locked

Started by dez on 2 Jun 2006, 12:06 PM · Views: 7,349

Results 1 to 19 of 19
This thread is locked. New replies are disabled.
2 Jun 2006, 12:06 PM
#1
dez avatar

dez

New Zenner

Join Date:
Jun 2006
Posts:
1
Plugin Contributions:
0

Error encountered while writing /includes/configure.php

Error encountered while writing /includes/configure.php - database setup

I have searched and read the other threads but they didnt seem to help,
Im getting this error on the database page of the installation.

The thing is when i download the configuration page to check it it has written everything to the page, so Im unsure why this error is occuring if it has managed to write to the page?

2 Jun 2006, 1:32 PM
#2
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: Error encountered while writing /includes/configure.php

Posting the full text of the error might also help.

Vger

6 Jul 2006, 1:44 AM
#3
docsnotary avatar

docsnotary

New Zenner

Join Date:
Jul 2006
Posts:
2
Plugin Contributions:
0

Re: Error encountered while writing /includes/configure.php

dez:

Error encountered while writing /includes/configure.php - database setup

I have searched and read the other threads but they didnt seem to help,
Im getting this error on the database page of the installation.

The thing is when i download the configuration page to check it it has written everything to the page, so Im unsure why this error is occuring if it has managed to write to the page?

After hours of headaches and searching these forums to no avail, I have finally gotten past this error.

What I did is to go back to the "System Setup" page in the installation and changed the referenced "Physical Path" to "/var/www/html/ZenCart", where I also had a full copy of ZenCart. Previously I had referenced a copy of ZenCart in a user directory under /home , since I had wanted that particular user to administer the ZenCart. Apparently putting ZenCart in a user's home directory is a no-no. It seems as if it can only function if it is under /var/www/html/ .

Prior to doing this I had also chown-ed both ZenCart directories recursively to be owned by user apache and group apache, since they had aquired root ownership from the way I ftp'ed them. I don't think this should be necessary because they were mode 777 anyway and that step didn't solve the problem. Just mentioning it in case someone can't replicate my success and it turns out to have been a necessary condition.

7 Jul 2006, 5:35 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Error encountered while writing /includes/configure.php

docsnotary:

What I did is to go back to the "System Setup" page in the installation and changed the referenced "Physical Path" to "/var/www/html/ZenCart", where I also had a full copy of ZenCart. Previously I had referenced a copy of ZenCart in a user directory under /home , since I had wanted that particular user to administer the ZenCart. Apparently putting ZenCart in a user's home directory is a no-no. It seems as if it can only function if it is under /var/www/html/ .

It can function just fine in a user's home directory.

However, you were not running the files FROM that home directory.

If you want to install Zen Cart to run from a certain place, you need to upload the files TO that place and run it from there.

The "zc_install" program doesn't actually install FILES... you have to upload via FTP manually. The zc_install process "configures" files and installs database-content.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Jul 2006, 7:55 PM
#5
justrestin avatar

justrestin

New Zenner

Join Date:
Jul 2006
Posts:
7
Plugin Contributions:
0

Re: Error encountered while writing /includes/configure.php

I have the same issue. OS is FreeBSD 6 i386 with MySQL 5.0.22 and php5.1.4

All the directory/ file permissions seem correct and I have even changed the ownership to www (As Apache runs on this box) to no avail.

I have attached a screen capture of what I get. :cry:

Thanks in advance

Drew

14 Jul 2006, 8:56 PM
#6
justrestin avatar

justrestin

New Zenner

Join Date:
Jul 2006
Posts:
7
Plugin Contributions:
0

Re: Error encountered while writing /includes/configure.php

The host and machine are mine, so root access is easy :D

No php is being run as a standard Apache module compiled with the Apache 2 handler

14 Jul 2006, 9:03 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Error encountered while writing /includes/configure.php

After writing the file, it reads it back, and if it doesn't find the same information as it wrote, then that error is displayed.

What is the content of the file? (without passwords, if any)

Factors preventing writing include:

  • permissions
  • ownership
  • disk-space-quota restrictions for the owner
  • filesystem capacity ... ie: is the server out of space, etc

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Jul 2006, 9:27 PM
#8
justrestin avatar

justrestin

New Zenner

Join Date:
Jul 2006
Posts:
7
Plugin Contributions:
0

Re: Error encountered while writing /includes/configure.php

configure.php

<?php /** * * @package Configuration Settings * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 */ // Define the webserver and path parameters // HTTP_SERVER is your Main webserver: eg, <http://www.yourdomain.com> // HTTPS_SERVER is your Secure webserver: eg, <https://www.yourdomain.com> define('HTTP_SERVER', 'http://www.pavingwarehouse.com'); define('HTTPS_SERVER', 'https://www.pavingwarehouse.com'); // Use secure webserver for checkout procedure? define('ENABLE_SSL', 'false'); // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes! // * DIR_WS_* = Webserver directories (virtual/URL) // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder) define('DIR_WS_CATALOG', '/'); define('DIR_WS_HTTPS_CATALOG', '/'); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/'); define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/'); define('DIR_WS_PHPBB', '/'); // * DIR_FS_* = Filesystem directories (local/physical) //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/ define('DIR_FS_CATALOG', '/home/pavingwarehouse/public_html/'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/'); define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS); define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/'); // define our database connection define('DB_TYPE', 'mysql'); define('DB_PREFIX', 'paving_'); define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty define('DB_SERVER_USERNAME', '******'); define('DB_SERVER_PASSWORD', '*******'); define('DB_DATABASE', 'paving'); define('USE_PCONNECT', 'false'); // use persistent connections? define('STORE_SESSIONS', 'db'); // leave empty '' for default handler or set to 'db' // The next 2 "defines" are for SQL cache support. // For SQL_CACHE_METHOD, you can select from: none, database, or file // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder // ie: /path/to/your/webspace/public_html/zen/cache -- leave no trailing slash define('SQL_CACHE_METHOD', 'database'); define('DIR_FS_SQL_CACHE', '/home/pavingwarehouse/public_html/cache'); Looks all as I entered it.
14 Jul 2006, 10:00 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Error encountered while writing /includes/configure.php

Well, your filesystem permissions are set incorrectly.
Something's awry with ownership and permissions, preventing the apache user (whether that's www, nobody, root, etc) from being able to write reliably to the file. You'll notice that the installer is saying the files are not writable, if you restart the zc_install process again.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Jul 2006, 10:14 PM
#10
justrestin avatar

justrestin

New Zenner

Join Date:
Jul 2006
Posts:
7
Plugin Contributions:
0

Re: Error encountered while writing /includes/configure.php

My permissions are now:

root@wwwhost /usr/home/pavingwarehouse/public_html/includes % ls -al
total 94
drwxrwx--- 13 www www 1024 Jul 14 20:23 .
drwxrwx--- 14 www www 512 Jul 14 08:16 ..
-rw-r--r-- 1 www www 639 Apr 4 2005 .htaccess
-rw-r--r-- 1 www www 807 Feb 12 23:59 application_bottom.php
-rw-r--r-- 1 www www 4108 Mar 14 15:19 application_top.php
drwxr-xr-x 3 www www 512 Jun 21 20:04 auto_loaders
-rw-r--r-- 1 www www 3740 Feb 12 23:59 autoload_func.php
drwxr-xr-x 5 www www 1024 Jun 21 20:04 classes
-rw-r--r-- 1 www www 2989 Jul 14 23:12 configure.php
-rw-r--r-- 1 www www 2214 Mar 15 19:17 counter.php
-rw-r--r-- 1 www www 5943 Dec 31 2005 database_tables.php
-rw-r--r-- 1 www www 3077 Feb 27 19:09 dist-configure.php
drwxr-xr-x 2 www www 512 Jun 21 20:04 extra_cart_actions
drwxr-xr-x 2 www www 512 Jun 21 20:04 extra_configures
drwxr-xr-x 2 www www 512 Jun 21 20:04 extra_datafiles
-rw-r--r-- 1 www www 9323 Apr 17 20:56 filenames.php
-rw-r--r-- 1 www www 5226 Dec 31 2005 form_check.js.php
drwxr-xr-x 3 www www 1024 Jun 21 20:04 functions
-rw-r--r-- 1 www www 5842 Apr 4 2005 general.js
-rw-r--r-- 1 www www 111 Oct 22 2005 index.html
drwxr-xr-x 2 www www 512 Jun 21 20:04 index_filters
drwxr-xr-x 3 www www 1024 Jun 21 20:04 init_includes
drwxr-xr-x 4 www www 512 Jun 21 20:04 languages
-rw-r--r-- 1 www www 2241 Feb 25 18:14 main_cart_actions.php
drwxr-xr-x 9 www www 1536 Jun 21 20:04 modules
-rw-r--r-- 1 www www 5001 Jan 4 2006 spiders.txt
drwxr-xr-x 4 www www 512 Jun 21 20:04 templates
-rw-r--r-- 1 www www 1002 Jun 6 04:23 version.php

with Apache running as www and still I get the same error. When I start over, the initial check shows no errors.

Thanks for all your help so far. I have to say it really has me foxed.

Interestingly, I just noticed that configure.php has changed back to 644, where I set it to 777. i have just re-run the installation screen and that file definitely gets its permissions saved as 644 even though it was 777 before hitting Save Database Settings.

Drew

14 Jul 2006, 10:27 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Error encountered while writing /includes/configure.php

The installer attempts to set it to 644 when finished.
Since it's able to do that, then the problem must have to do with ownership.

Who "owns" the files? ie: version.php vs configure.php etc

Chances are your 644 isn't working well with ownership.... even though "4" for "everyone" should work ... but "root" ownership etc can often be confusing

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Jul 2006, 10:38 PM
#12
justrestin avatar

justrestin

New Zenner

Join Date:
Jul 2006
Posts:
7
Plugin Contributions:
0

Re: Error encountered while writing /includes/configure.php

OK I see where you are coming from but all the files are owned by www the Apache user (See my previous post) so shouldn't have any problems. I have now gone all the way down to the root level with these permissions.

Is there any way to by pass this section as I am sure the configure.php file is correct?

14 Jul 2006, 11:16 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Error encountered while writing /includes/configure.php

justrestin:

Is there any way to by pass this section as I am sure the configure.php file is correct?

Sure -- but just be forewarned that there may be "other" issues with your site's security setup if this sort of problem is occurring.

Edit zc_install/includes/modules/pages/database_setup/header_php.php
line 92.
Add a // at the beginning of the line, like this:```php
// $zc_install->setError(ERROR_TEXT_COULD_NOT_WRITE_CONFIGURE_FILES, ERROR_CODE_COULD_NOT_WRITE_CONFIGURE_FILES, true);

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

14 Jul 2006, 11:33 PM
#14
justrestin avatar

justrestin

New Zenner

Join Date:
Jul 2006
Posts:
7
Plugin Contributions:
0

Re: Error encountered while writing /includes/configure.php

Thanks :cool: , it all went through no problem until:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''STORE_NAME'' at line 1
in:
[select configuration_title from paving_configuration where configuration_key='STORE_NAME']

I guess that is the less supported MySQL5 issues that were mentioned on the initial set up page :(

15 Jul 2006, 2:34 AM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Error encountered while writing /includes/configure.php

No ... that's a result of you ignoring the warning that magic-quotes-runtime are enabled on your site.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

15 Jul 2006, 7:44 AM
#16
justrestin avatar

justrestin

New Zenner

Join Date:
Jul 2006
Posts:
7
Plugin Contributions:
0

Re: Error encountered while writing /includes/configure.php

Oops, :blush: you are absolutely right. All done and fully operational now!

THANK YOU SO MUCH!!! :thumbsup:

22 Oct 2006, 1:34 AM
#17
sleastack avatar

sleastack

New Zenner

Join Date:
Oct 2006
Posts:
18
Plugin Contributions:
0

Re: Error encountered while writing /includes/configure.php

I have been stumped for a week on this one.

I have another installation working without any hassle.

Now I am trying to test 1.3.5 and all my permissions and ownerships are good, but for some reason it wont let me get further than the install screen.

My host is mediatemple.

help!!

24 Oct 2006, 8:43 AM
#18
sleastack avatar

sleastack

New Zenner

Join Date:
Oct 2006
Posts:
18
Plugin Contributions:
0

Re: Error encountered while writing /includes/configure.php

Solved it..

After 3 times of uploading with CuteFTP with Default settings. I deleted and turned off all speed boosts and made it check the integrity of the files and it finally worked.

Apparently Zen is very particular about the file accuracy(good to know)

Good Luck

24 Oct 2006, 12:12 PM
#19
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: Error encountered while writing /includes/configure.php

As I have said many times - use a good, reliable, FTP programme. Cute FTP does not fit that description - FileZilla and WS FTP do.

Vger