I have this project which has always been developed live without a local environment. I've been requested to move it to a local machine for demo purposes.

I started by installing XAMPP on the local machine and configured Apache to run the site out of a directory in 'My Documents' via virtual hosting. Then I tar'ed and zip'ed the code on the server, downloaded it, and extracted it into the local directory.

Next I used phpMyAdmin on the server to export a couple necessary databases and imported them into the local environment using phpMyAdmin again.

I don't know if this relates to the problem I'm having, but the live site uses the RewriteEngine to redirect URLs.

Now for the actual problem. I started browsing the local site and surprisingly, everything seems to work fine. The one hitch I'm having is with preg_match.

I like to separate my HTML from my PHP so I typically place all HTML relevant to a particular page in it's own .html file. I section off portions of the html with comments. When I need a particular section of HTML from the .html file, I open the file and use preg_match to pull that section from the file.

When I try to view the page that is blowing up, the browser just sits there and gives me a 'The page cannot be displayed' error. This is shown at the bottom of this post.

The server is using PHP 4.4.
The local machine is using PHP 5.1.4

Here is the code that works on the server and blows up on the local machine. Note that the code works fine on the local machine if I comment out the call to preg_match.
CODE

   $form = file_get_contents(COMPONENT_DIRECTORY
                               . 'frmNewServiceRequest.html');
   $regex = '/<!--NSR_INITIAL_FORM!-->(.|[\n])*<!--NSR_INITIAL_FORM!-->/';
   preg_match($regex, $form, $matches);
   $form = $matches[0];

Here is the section of the .html file:
CODE

<!--NSR_INITIAL_FORM!-->
{JAVASCRIPT}
<div id="wvNewServiceRequest">
 <div class="hidden">
   {DEFECTS}
 </div>
 <form id="frmNewServiceRequest" class="normtxt" method="{METHOD}" action="{ACTION}">
   <input type="hidden" name="submit_type" value="{SUBMIT_TYPE}">
   <input type="hidden" name="room_type" value="{ROOM_TYPE}">
   <div id="frmNSR_Rows">
     <div id="frmNSR_SeedRow">
       <!--DYNAMIC_ROW!-->
       <div id="frmNSR_DynRow{ROW}">
         <div class="frmNSR_Row">
           <table>
             <tr>
               <td id="row_disp{ROW}" class="fldItem">
                 <div class="{CLASS_ROW_ERROR}">
                   {ROW_DISP}
                 </div>
               </td>
               <td class="fldRoom">
                 {ROOM}
               </td>
               <td class="fldDesc">
                 <input type="text" name="txtSrvcDesc_{ROW}"
                        value="{DEFAULT_DESC}">
               </td>
               <td class="btnDelRow">
                 <div class="{CLASS_DEL_ROW}">
                   <input type="button" class="button" name="btnDel" value="-"
                          onClick="javascriptp:jsNSR_DelRow({ROW});">
                 </div>
               </td>
             </tr>
             <tr>
               <td class="fldTrade" colspan="2">
                 {TRADE}
               </td>
               <td id="slug_defect_{ROW}" class="fldDefect">
                 {DEFECT}
               </td>
             </tr>
           </table>
         </div>
       </div>
       <!--DYNAMIC_ROW!-->
     </div>
     <div class="frmNSR_Usage">
       {USAGE}
     </div>
     <div class="{ERRORS_PARENT_CLASS}">
       <div class="frmNSR_Errors">
         {ERRORS}
       </div>
     </div>
     <div class="frmNSR_Row">
       <table>
         <tr>
           <td class="fldItem">
             <b>Item</b>
           </td>
           <td class="fldRoom">
             <b>Room</b>
           </td>
           <td class="fldDesc">
             <b>Description</b>
           </td>
         </tr>
       </table>
     </div>
     {ROWS}
   </div>
   <div class="frmNSR_AddRow">
     <input type="button" class="button" name="btnAddRowMult" value="Add 5 Items"
            onClick="javascriptp:jsNSR_AddRow(5);">
     <input type="button" class="button" name="btnAddRow" value="Add Item"
            onClick="javascriptp:jsNSR_AddRow(1);">
     {TT_ADDROWS}
   </div>
   <div class="frmNSR_Row">
     <div class="frmNSR_textarea">
       Please enter any additional comments or requests below:
       <textarea name="txtComments" wrap="nowrap">{DEFAULT_COMMENTS}</textarea>
     </div>
   </div>
   <div class="frmNSR_SubmitRow">
     <input type="submit" class="button" name="submit" value="Submit Service Request">
   </div>
 </form>
</div>
<!--NSR_INITIAL_FORM!-->


The browser tells me this:
CODE

Please try the following:

Click the  Refresh button, or try again later.

If you typed the page address in the Address bar, make sure that it is spelled correctly.

To check your connection settings, click the Tools menu, and then click Internet Options. On the Connections tab, click Settings. The settings should match those provided by your local area network (LAN) administrator or Internet service provider (ISP).
See if your Internet connection settings are being detected. You can set Microsoft Windows to examine your network and automatically discover network connection settings (if your network administrator has enabled this setting).
Click the Tools menu, and then click Internet Options.
On the Connections tab, click LAN Settings.
Select Automatically detect settings, and then click OK.
Some sites require 128-bit connection security. Click the Help menu and then click About Internet Explorer to determine what strength security you have installed.
If you are trying to reach a secure site, make sure your Security settings can support it. Click the Tools menu, and then click Internet Options. On the Advanced tab, scroll to the Security section and check settings for SSL 2.0, SSL 3.0, TLS 1.0, PCT 1.0.
Click the  Back button to try another link.



Cannot find server or DNS Error
Internet Explorer