Web Hosting Forum | Lunarpages

Author Topic: Installing 3rd Party scripts and editing them.  (Read 3110 times)

Offline Mark Cale

  • Spaceship Navigator
  • *****
  • Posts: 84
Installing 3rd Party scripts and editing them.
« on: November 10, 2007, 09:34:52 AM »
Hi,

It has been a while since, I have posted anything on here. I have been researching a lot of applications and scripts that I have seen customers ask for assistance on helpdesk. Which when you get 500 errors or a specific PHP include needs to be turned on or off, this can all be done by you. The way PHP is setup on our servers suPHP is used, creating a php.ini and placing the ini file the specific line you need for your script/application to work. Mostly the scripts and applications you download and unzip then upload to your site to use is generally set to run on a dedicated server, not a shared server environment.
Which, run fine on your local machine, but all of a sudden donít work on your account. This is again because you have to edit certain files on the script or application which are the .htaccess, config, php.ini and of course reading the installation text file for knowing the right permissions to be set of certain folders.

What are most commonly seen are applications that require register_globals.

After naming a few things seen when a customer installs a script, now I would like to provide a formula for anyone to use that should resolve the issues faced from these script installations.

==================  Does it have an .htaccess file?======================
First letís start with the application or script, does it have itís own .htaccess file?
This is very important, why? Due to most applications or scripts you are going to need to modify since by default these are developed for a dedicated server so keep this in mind!
You will need to either use the search in your OS program to search the .htaccess files which is faster or go through every folder in the application or script to check for .htaccess files embedded in the folders. You can use a simply text editor to edit the files and save them, the ones that have Deny all IP or IP Deny all should be removed, these first of all prevent you from even doing the installation. Take care in what you modify as well, since really the most common issue is the deny IP lines or you may even see Deny from all, this is the same as mentioned these lines should be removed. You have some that use FrontPage and in the .htaccess file you will some of these lines, which this is the main reason why most issues come up with publishing as well.
Keep this rule in mind when working with scripts and applications you will need to review the .htaccess files that are embedded in the script or application.

================ Do you need to add PHP parsing lines?===================
First and foremost is what PHP includes should be turned on or off for the script or application to work.

To be right out with it, You are going to see that most scripts and applications right PHP parsing lines in the .htaccess file since on dedicated they are likely to parse through apache not suPHP, which this makes all the difference in the world!

If, you see PHP parsing lines in the .htaccess you will need to remove them and add them to a php.ini file.  Using a text editor like notepad for windows user or what available text editor used for other OS, you would first enter the lines needed then save them as php.ini and make sure the text editor always has in the drop down save as, ďall filesĒ this will then prevent this being saved as a .txt file

What anyone really needs to keep in mind that on our servers the register_globals = Off by default on the servers, you will need to add in the php.ini file    register_globals = On        you would only do this is your script or application returns an error  with globals or register_globals  If you account is on a dual PHP server which has the ability to switch from version 4 to version 5 you will need to make sure that either version being used has the exact modules needed for the script.

======================Database for the script=========================

You will need to create the database for the script or application since most installations do not have the ability to do this on itís own, using the scripts in Fantastico of cPanel does this for you this is because our Admins have implemented an auto-install script to assist you in getting some of the most popular scripts up and running on your account.

When doing this on your own this is a world of difference also.

Here are the steps for this:

1.   Open MySql in cPanel and then create the database name, save it and then create the database user and password then save it, now you will add the user to the database.

Database name will look like this when you are done,

cPanelusername_databasename

Username will look like this when you are done.
cPanelusername_databaseusername

Please note: that this example not the actual appearance of the names. This is only a generic description.

2. With most scripts and applications you have an install.php file here you will be asked during the install for the database name or use the one they provide, use the one you created in MySQL and the user and password as well.

You also will have to put a check in the installation somewhere that this database is a privileged user.


======================Knowing what is on the server====================
This is the most common issue with many accounts, is not knowing what modules are on the PHP includes. Support is always happy to assist you with answering if a particular module in compiled on the server. I would like to provide an exact way to you could find out what is on PHP so you know if the module you need is indeed compiled on the server.

As mentioned before, you can create certain files by using a text editor and also for this if you have web editor that has the ability to create php files you can use this as well.

Here is a simple way to create a phpinfo.php page so you can see what PHP is compiled on your account using a windows OS.

First open notepad, and then in notepad enter in this exactly,

<? echo phpinfo() ?> 

Now click file on the top left, then click save as,  the save dialog box will appear.

You will enter in the file name field: phpinfo.php
Then below is save as type here you will click the drop down and choose all files.

Now save it wherever you want it to be stored.

Now upload this file to the public_html folder if you have a basic or business plan and if you have a windows plan you will upload the file to the httpdocs folder.

Now once you do this please type in your browser this:

PLEASE NOTE: www.yourdomain is replaced with your domain name then add /phpinfo.php

http://www.yourdomain.com/phpinfo.php   

Now you can see what PHP modules are compiled on your account, if there is something you need please contact support with the module needed and we can see if we can assist you with this, also since the account is on a shared server environment it is likely that some modules will not be on any server due to security or stability issues.

With keeping all of this in mind, your experience with uploading and installing the scripts and applications you want on your account should be a pleasant and rewarding experience.

I hope this was a decent post for you, I am still researching on this issue and hope to have even more tips and tricks on this subject. My machine is getting overloaded with all of these scripts and applications to test and run.

So far what I have provided applies to them being installed and resolving the internal errors and 500 errors. More to come!

 

Share |