INSTALLATIONS

How to install Sphider on a Hosting account

install Sphider
install Sphider

How to install Sphider on cPanel or in a hosting account

This blog will help you to install Sphider on cPanel account (Use the same procedure to install Sphider on any web hosting environment). Sphider is a simple search engine written in PHP. It uses MySQL as its backend.

 
mkdir /home/$USER/public_html/sphider/
cd /home/$USER/public_html/sphider/
wget http://www.sphider.eu/sphider-1.3.6.zip
unzip sphider-1.3.6.zip

Change the ownership of the directory sphider with $USER:$USER once the files are unzipped.

 
chown $USER:$USER /home/$USER/public_html/sphider -R

Delete the zip file.

 
rm -f sphider-1.3.6.zip

Then create a database and a database user to use them on Sphider configuration. Also, please do not forget to add the database user to the database and give the appropriate permissions.

In settings directory, edit database.php file and change $database, $mysql_user, $mysql_password and $mysql_host to correct values.

 
cd /home/$USER/public_html/sphider/settings
vim database.php

Then open install.php script in your browser (eg: http://YOUR_DOMAIN.com/sphider/admin/install.php). It will create necessary tables for Sphider, but there is a chance of getting following error during this process.

 
Error: 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 '(14), elapsed float(2), 
results int, key query_key(query))' at line 3

Please change the following variables in the “install.php” file if you received the above error.

Search for the following section:

 
mysql_query("create table `".$mysql_table_prefix."query_log` (
query varchar(255),
time timestamp(14),
elapsed float(2),
results int, 
key query_key(query))");

Replace the above with:

 
mysql_query("create table `".$mysql_table_prefix."query_log` (
query varchar(255),
time timestamp,
elapsed float(2),
results int, 
key query_key(query))");

i.e., There is no such thing as a timestamp(14). The code should just be: time timestamp

If the above changes are made, please delete and recreate the database again and add the database user to it with appropriate permissions. Then call install.php file via browser again. It should fix the issue at this time and successfully create the tables.

Then you need to edit the auth.php file in admin directory to change the administrator username and password (default values are ‘admin’ and ‘admin’).

 
vim /home/$USER/public_html/sphider/admin/auth.php

Now you can login to the Sphider control panel with the provided admin login details using the following URL via a browser.

http://YOUR_DOMAIN.com/sphider/admin/admin.php

Also, please note that the search.php is the default search page.

That’s it!

If you like this post and wish to receive more articles from us, please like our FB page: Grepitout

Your suggestions and feedbacks will encourage us and help to improve further, please feel free to write your comments.

For more details on our services, please drop us an E-mail at info@grepitout.com

Topics