Wednesday, August 3, 2016

FoxPro: Table '' has become corrupted. The table will need to be repaired before using again.

I came across this error while trying to run an old foxpro application to analyse and understand some functionality which i need to replication in an new application that am working on.

Quick google search helped me fix it fast, might not be the appropriate way but it gave me a swift go towards my goal.
Am using VFP 9.0 IDE, so follow and type these commands in your command window


  1. CD to the path location to the corrupt table.
  2. SET TABLEVALIDATE TO 0 && this disables table validate for the current session
  3. USE size && open, select the corrupt table
  4. COPY STRUCTURE TO size1 && copy table structure to a new temp table
  5. USE size1 && select, open up the temp table
  6. APPEND FROM size && append all the data from the corrupt table to the new table



That is it, delete the old corrupt table and then rename the new temp table with the desired table name because it has all the old table data.

Hope it help, happy coding ;)

Thursday, March 17, 2016

Installing symfony on windows, PHP Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

I am trying out the symfony framework and a novice with Php language. When doing a symfony installation, i got the mentioned error of SSL operation failing as shown below
  SSL failure
Am using windows 7, XAMPP handling the web server and database server. A search on the web gives lots of solutions related to SSL operation failed but not so much related to solve it for symfony installation in simple terms.
Found a link here which i followed to solve my problem at hand. It is not the best but at-least lets you passed that error.

  1. First add php path to the windows enviroment variables (my case "D:\xampp\php")
  2. Create a install.php file in your web server www folder and insert the code below
    <?php
    $arrContextOptions=array(
    "ssl"=>array(
    "verify_peer"=>false,
    "verify_peer_name"=>false,
    ),
    );
    $response = file_put_contents('symfony', file_get_contents('https://symfony.com/installer', false, stream_context_create($arrContextOptions)));
    echo $response;
    ?>
    It should look like below in ur favorite editor
     
    Browse the install.php file url in your browse and expect to get a response similar to the one below

    Expect to find a new file "symfony" in your www folder.  
  3. Open up the command prompt (CMD) as administrator, navigate to the webserver publish folder or www folder, as the symfony installation instructions say, run the command "php symfony" to check if installer is usable.
  4. Now ready to create your first symfony project, type "php symfony new my_proj" in your command prompt and wait for the installer to pull all files down to your disk.
Enjoy !