Installation script not working

Hi,

I’ve written an installation script for a CMS that has been working well on a number of sites. Today someone emailed me saying that they received an error partway through the installation:

Warning: touch() [function.touch]: Unable to create file …/data/secure/db_vars.php because No such file or directory in /mnt/web2/13/65/51649265/htdocs/installer/install.php on line 0

This is supposed to create the file db_vars.php with the database variables entered by the user.

Any idea why it might not be working? I’d rather avoid asking the user to create the file manually (or edit an existing file and upload it), but if that’s what has to be done, then at least it would solve the problem.

Thanks.

Some servers dont allow files to create folders or other files. Does your script try to set up folders with permissions or is that done by the user?

I would have the user CHMOD the folder that its creating the file in or atleast check to make sure its allowed to create files within it.

Worth a shot.

The script creates the db_vars.php file but it doesn’t create or CHMOD any folders. A few empty folders are uploaded with the PHP files and the user has the CHMOD them.

I’ll find out if the user has set the correct permissions on the folder. I’m guessing that they know how to CHMOD because the script writes to a file before it gets to the db_vars.php step, and if the script couldn’t write to the file, it would fail at that point.

If they have done the CHMOD correctly then I will extend the installer for this circumstance, if some servers don’t allow files to be created then I’ll have to get users to edit the file offline and upload it. Not ideal but what can you do?

Thanks for the reply. :D

Sponsor our Newsletter | Privacy Policy | Terms of Service