我的WordPress 3.9.2托管在Rackspace Cloud上。我做了一个应用程序来上传CSV文件到数据库。这个CSV文件上传和更新数据库超时,因为它经过了30秒,连接被切断了。我和支持团队聊天,他们引导我到这个网站,我不知道如何在我的脚本上使用它。下面是我目前使用的脚本。
<?php
/* After file is uploaded to the Server */
$fp = fopen($location, 'r');
$datas = array();
$fgetcsv = fgetcsv($fp);
while ( ($data = fgetcsv($fp) ) !== FALSE ){
/* Loop and insert into database */
}
?>
<?php
/* After file is uploaded to the Server */
$fp = fopen($location, 'r');
$data = array();
while ( ($data = fgetcsv($fp) ) !== FALSE ){
sleep(1);
echo ".";
flush();
/* Loop and insert into database */
}
?>
试试这个。