You need to do something like this:
exec('php /var/www/web/shop_xml/index.php "'.escapeshellarg($row['SKID']).'" "1" > /dev/null 2>&1 &');
Then, in your index.php script:
<?php
$shopKeeper = $argv[1];
$shop = $argv[2];
// ... do stuff
What you have attempted to do is use a HTTP query string in a file system invoke, which will not work. You need to pass the data as command-line arguments, like you would in a terminal. Then, you can get the data from $argv.
You need to start the command with php otherwise the kernel will (most likely, unless you add a hashbang and set permissions) not know how to execute the script, or have permissions to do it.
If you add > /dev/null 2>&1 & the commands will be run asynchronously, i.e. you will not have to wait for the last command to finish before you can invoke another. Be carefull with this though, you could end up with many processes if your query returns many rows.
To avoid this, you could do somthing like:
<?php
// Number of records to process at a time
$perBatch = 5;
set_time_limit(0);
//connect to database
$msSqlDB = new mySqlConnect('Freewebstore');
// Get the number of records in the table
$query = "SELECT count(*) FROM FacebookStores";
$result = mysql_fetch_row(mysql_query($select));
$count = $result[0];
for ($i = 0; $i < $count; $i += $perBatch) {
// Get $perBatch records from the DB
$query = "SELECT * FROM FacebookStores LIMIT $i,$perBatch";
$result = mysql_query($select);
for ($j = 1; $row = mysql_fetch_array($result); $j++) {
// Base command
$command = 'php /var/www/web/shop_xml/index.php "'.escapeshellarg($row['SKID']).'" "1"';
// Run all except the last asynchronously
if ($j < $perBatch) {
$command .= ' > /dev/null 2>&1 &';
}
exec($command);
}
}
This would get $perBatch records from the DB at a time, and process all but the last asynchronously. This would result in them being processed roughly $perBatch records at a time, and help to avoid a large number of processes eating server resources.
As a side note, you seem to be using an odd mix of OO DB code and procedural DB code - you should stick to one or the other to avoid confusion.
No such file or directory: index.php?shopKeeper