Jump to content

Installation of a php script (Note, this is PHP help! Not PHP installation!)


Recommended Posts

I'm looking at ways to allow my script to be used, with a minimum of fuss, on any server.

 

I'm going to use an install script, but I don't want to require the user to touch any server settings or delete the file after use due to the security risk)

 

Can anyone suggest any methods of allowing a script to be run once, and only once. Once the user hits submit, it's done.

 

Caveats:

I can't use mysql for checking - I want the setup procedure completely database independant.

 

Any suggestions?

The only thing I can think of is to write a file out.  Even this technique can have issues, if permissions or configuration don't allow the creation of a file, but this is something you could check for in your script. 

That's not a bad idea.

 

Again I'd assume not foolproof - but I like it more than writing a value to that file and checking it.

 

Is it possible to delete a file from PHP? More importantly, is it possible for a script to delete itself?

 

That way, I could attempt to delete the install script - and if that doesnt work write the file. If I can't delete my install file, neither can anyone else delete my created file.

 

The more I think about it, the more I like it. Thanks guys :)

 

Any other thoughts welcome

yeah, just try it. I've found nothing form a quick google of it.

 

Make sure you copy it though :P

 

I think the ervre runs through the file for errors before it actually executes the script, so hopefully even though the file s deleted, it may still run the rest of it.

That's not a bad idea.

 

Again I'd assume not foolproof - but I like it more than writing a value to that file and checking it.

 

Is it possible to delete a file from PHP? More importantly, is it possible for a script to delete itself?

 

That way, I could attempt to delete the install script - and if that doesnt work write the file. If I can't delete my install file, neither can anyone else delete my created file.

 

The more I think about it, the more I like it. Thanks guys :)

 

Any other thoughts welcome

 

 

Yes it is possible -- but a really bad idea in my opinion.  From a security issue most people don't want to allow the writing and deleting of files from webspace, as this is a good way to get exploited.  Some systems require this in order to allow full functionality (Joomla/Mambo for example) but they are CMS systems with modules. 

 

You might also consider using sqllite which is a really lightweight embedded db that comes with PHP, and would require no installation by the end users. 

Yes it is possible -- but a really bad idea in my opinion.  From a security issue most people don't want to allow the writing and deleting of files from webspace, as this is a good way to get exploited.  Some systems require this in order to allow full functionality (Joomla/Mambo for example) but they are CMS systems with modules. 

 

You might also consider using sqllite which is a really lightweight embedded db that comes with PHP, and would require no installation by the end users. 

 

It's imperative that the user be able to install the script with no required admin input. I'm assumiing that they have a fully set up web server, but (unless there is a problem) I want a non-technical user to be able to install the script 9 times out of 10.

 

SQLlite might be an option - is there any performance loss once you get into bigger databases or other problems to watch for? I want the application very scaleable. And this will also be a modulated CMS/framework to an extent.

 

On the other hand, SQLlite might be a option for storing settings and the installation process. Thanks for the suggestion

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.