Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6702575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:04:11+00:00 2026-05-26T07:04:11+00:00

I have a PHP application which runs on production like this : <?php /*

  • 0

I have a PHP application which runs on production like this :

<?php

    /*
    Do some work here
    */

    /* if https environment, redirect to secure next url */
    if(empty(isset["HTTPS"]) == true )  /* FIRST DEPENDECY */
    {
      header("location : https://mynext_prod_url?parameters"); /*SECOND DEPENDENCY */
    }
    else
    {
       header("location : http://mynext_prod_url?parameters");
    }
?>

This works absolutely fine in production where a SSL certificate is installed.
To simulate the same scenarios in development, I can overcome first dependency,
but how shall I overcome the second ?

/* Development example with workarounds */

  <?php

        /*
        Do some work here
        */
        $_SERVER['HTTPS'] = "TRUE" ;         /* fake HTTPS  */   

        if(isset($_SERVER["HTTPS"]) == true )  /* FIRST DEPENDECY SOLVED */
        {
          /* BUT THIS URL DOES NOT WORK AS IT ONLY EXISTS ON HTTP */
          header("location : https://mynext_dev_url?parameters"); 
        }
        else
        {
           header("location : http://mynext_dev_url?parameters");
        }
    ?>

How can I install a temporary certificate for development purpose ?
Or somehow fake the environment .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:04:12+00:00Added an answer on May 26, 2026 at 7:04 am

    You can create your own certificates that you can use in development. The mechanism to create certificates varies, by the platform. Here is an article about how to create one using XAMPP on Windows:

    http://jaswanttak.wordpress.com/2010/04/15/configure-ssl-on-xampp-and-windows/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a basic ajax application, which will not work, instead the php code
I have a application which runs over browser ...php application... i need to lock
We have this PHP application which selects a row from the database, works on
at work we have a web-based PHP-application which acts as the single UI that
I have a PHP application which runs a large set of SQL files. It
I have a PHP web application which uses a MySQL database for object tagging,
I have written a PHP application which requires storage of millions of integers between
I have a custom built application framework written in PHP which I have been
I have installed my PHP scripts which runs over Apache server in a Windows
If I have a PHP application which allows users to make changes to documents,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.