apache php 脚本,PHP脚本创建多个apache2进程

我刚从

Ubuntu 14号

具有

菲律宾比索5.6

乌班图18.04

具有

pH7.2级

我的服务器规范是:

服务器版本:Apache/2.4.29(Ubuntu)

服务器建成时间:2019-09-16T12:58:48

菲律宾比索7.2.24

我注意到我有很多apache2进程有时会打开,我的服务器会崩溃,我需要重新启动mysql和apache。

通过一些测试,我终于找到了问题的根源:

我有一个在Magento中导入客户的脚本(非常基本),实际上有很多脚本,当我运行它们时,所有这些进程都会被创建。

谢谢,谢谢你的帮助。

这些模块当前在apache2中启用:

core_module (static)

so_module (static)

watchdog_module (static)

http_module (static)

log_config_module (static)

logio_module (static)

version_module (static)

unixd_module (static)

access_compat_module (shared)

alias_module (shared)

auth_basic_module (shared)

authn_core_module (shared)

authn_file_module (shared)

authz_core_module (shared)

authz_host_module (shared)

authz_user_module (shared)

autoindex_module (shared)

cache_module (shared)

deflate_module (shared)

dir_module (shared)

env_module (shared)

expires_module (shared)

file_cache_module (shared)

filter_module (shared)

headers_module (shared)

mime_module (shared)

mpm_prefork_module (shared)

negotiation_module (shared)

php7_module (shared)

proxy_module (shared)

proxy_balancer_module (shared)

proxy_http_module (shared)

reqtimeout_module (shared)

rewrite_module (shared)

setenvif_module (shared)

slotmem_shm_module (shared)

socache_shmcb_module (shared)

ssl_module (shared)

status_module (shared)

unique_id_module (shared)

require_once(realpath(__DIR__) . '/bootstrap.php');

$websiteId = 237;

$storeId = 0;

$row = 1;

$myfile = fopen("../errors.txt", "w+") or die("Unable to open file!");

if (($handle = fopen("staff.csv", "r")) !== FALSE) {

while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {

$roles = $data[6];

$xname = explode(" ", $data[0]);

$pass = "pass"; [5]."\n";}

$customer = Mage::getModel("customer/customer");

$customer->setWebsiteId($websiteId)

->setStoreId($storeId)

->setFirstname($data[0])

->setLastname($data[1])

->setEmail($data[3])

->setTelephone('01234567')

->setPassword($pass);

try{

$customer->save();

}

catch (Exception $e) {

Zend_Debug::dump($e->getMessage());

}

}

fclose($handle);

}

?>

引导代码:

ini_set('memory_limit', '1024M');

set_time_limit(0);

require_once realpath(__DIR__) . '/../../../www/app/Mage.php';

Mage::setIsDeveloperMode(true);

Mage::app('admin')->setUseSessionInUrl(false);

$userModel = Mage::getModel('admin/user');

$userModel->setUserId(0);

Mage::getSingleton('admin/session')->setUser($userModel);

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

error_reporting(-1);

ini_set('display_errors', 1);

?>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值