Install Free Image Search Engine

Introduction


This guide will walk you through the process of uploading and installing a PHP script to your web server. By the end of this guide, you should have your PHP script successfully installed and configured.

Prerequisites

  • A web hosting account that supports PHP.
  • FTP access to your web server or a web-based file manager provided by your hosting provider.
  • A zipped file containing your PHP script.
  • A text editor (like Notepad for Windows, TextEdit for macOS, or any code editor).

Server Requirements

  • PHP Version: PHP 7.2 or higher is recommended. The script utilizes modern PHP features and syntax that may not be compatible with older versions.
  • cURL: Enabled cURL is required for making API requests to the image providers. cURL is a library that allows you to connect and communicate with different types of servers with many different types of protocols.
  • JSON Support: Since responses from the APIs are typically in JSON format, your PHP installation must support JSON parsing.
  • GD Library (Optional): For image processing features such as resizing or watermarking, the GD Library should be installed and enabled. This is optional and only needed if you plan to manipulate images directly within your script.
  • htaccess Support (for Apache): If you're using Apache, ensure that .htaccess files are enabled through the AllowOverride All directive for your site directory. This is useful for URL rewrites and redirects.
  • Apache or Nginx: Both are suitable, but ensure your server is configured to handle PHP files and rewrite rules if you're using friendly URLs

API Requirements

API Keys: You'll need to register and obtain API keys from Dreamstime, Pexels, and Pixabay. These keys allow your script to authenticate and retrieve images from these services.

Step-by-step Guide


1. Uploading the PHP Script to Your Web Server:
Using FTP:

Launch your FTP client (e.g., FileZilla, Cyberduck).
Connect to your web server using the credentials provided by your hosting provider.
Navigate to the directory where you'd like to install the PHP script.
Upload the zipped file containing your PHP script to this directory.

Using a Web-based File Manager:


Log into your web hosting control panel.
Navigate to the file manager.
Go to the directory where you'd like to install the PHP script.
Use the "Upload" option to upload the zipped file.
2. Unzipping the Files:
Using FTP: Most FTP clients do not support unzipping files directly on the server. You'd need to unzip the file on your computer and then re-upload the extracted files to your server.

Locate and open the site-config.php file.


Make the following changes:

1. Site Name:

$site_name = "Your Site Name";

Here, you need to replace "Your Site Name" with the actual name you'd like to display for your website.

For instance, if your website's name is "My Cool Website", then you'd edit it as:

$site_name = "My Cool Website";

2. Ad Code:

$ad_code = "
    <!-- Your Ad Code Here -->
";

If you have any advertisement code you'd like to integrate into your website (e.g., Google AdSense code, or any other ad network code), replace <!-- Your Ad Code Here --> with that ad code.

3. Google Analytics:

$google_analytics_code = "
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src='https://www.googletagmanager.com/gtag/js?id=YOUR-GA-MEASUREMENT-ID'></script>
    ...
";
Replace YOUR-GA-MEASUREMENT-ID in both places with your actual Google Analytics Measurement ID. This ID usually starts with UA- followed by a series of numbers.

4. Google reCAPTCHA Keys:

$recaptcha_site_key = "6Lcq51YfAAAAAFmL9Ov2U-DEkXLYkLvohkzUf9F2";
$recaptcha_secret_key = "6Lcq51YfAAAAAISuJtib6QvBkl5_1vLRUwAKOuWl";

Replace the placeholder values with the actual reCAPTCHA keys you get from the Google reCAPTCHA website.

5. Social Media Links:

Replace the placeholder URLs with your actual social media profile URLs:

$facebook_link = "https://www.facebook.com/yourprofile";
$twitter_link = "https://twitter.com/yourprofile";
//... and so on.


Replace the placeholder values with your actual affiliate IDs provided by Pixabay, Pexals and Dreamstime.

6. API Keys:

// API Keys
$PIXABAY_API_KEY = "42344202-ba7ddkjsd9834jkld72bf33";
define('DREAMSTIME_USERNAME', 'username');
define('DREAMSTIME_PASSWORD', '234424asdkjl32904s40ed6af87d');
define('PEXELS_API_KEY', '36TIIESLivSsldfjkKLsdfesf39Lics5Cflbmof');

Replace the above placeholders with the actual API keys you receive from these services. You can find some links to the services so you can sign up for an account and generate your own unique affiliate IDs.

Wrapping Up


You've now successfully uploaded, extracted, and configured your PHP script on your web server. It's essential to test the functionality of the script to ensure everything works as expected. Navigate to the URL where you uploaded the script and test the features.

Note: Always keep your API keys and sensitive information confidential. Sharing this document with others might expose important credentials. Regularly back up your configurations and consider encrypting sensitive information for added security.