简体   繁体   English

共享托管CPanel Linum Godaddy

[英]shared hosting CPanel linum godaddy

I have a shared hosting Cpanel Linux 我有一个共享的托管Cpanel Linux

I am trying to parse a XML file with over 3000 products in it.. I am getting a 500 Internal error while I am trying to parse it.. I go to "Select PHP version" through the Dashboard and "Switch to PHP Options" I have these settings: max_execution_time: 6000 memory_limit: 512M post_max_size 128MB upload_max_filesize 512MB 我正在尝试分析包含3000多种产品的XML文件。尝试解析它时,我收到500内部错误。我通过仪表板转到“选择PHP版本”,然后转到“切换到PHP选项”我有以下设置:max_execution_time:6000 memory_limit:512M post_max_size 128MB upload_max_filesize 512MB

my file is almost 2MB so I guess the problem is not there.. The execution time stops the parsing at 2 minutes.. I have already upload a custom file php.ini with this inside: max_execution_time: 6000 I have also tried to upload a file named user.ini, with the same value.. but nothing works.. I have PHP version 5.6 我的文件将近2MB,所以我想问题不存在。.执行时间在2分钟后停止了解析。.我已经上传了一个自定义文件php.ini,其中包含:max_execution_time:6000我也试图上传一个名为user.ini的文件,具有相同的值..但没有任何效果..我有PHP版本5.6

the only value at 120 (seconds I guess) is this: realpath_cache_ttl but I do not know what this is... Any ideas please? 唯一的值为120(我猜是秒)是:realpath_cache_ttl,但我不知道这是什么...请问任何想法?

*In localhost xampp, I had the same problem, but by increasing the value of max_execution_time at 6000 the problem solved *在localhost xampp中,我遇到了同样的问题,但是通过将max_execution_time的值增加为6000,问题得以解决

ok I could not find any solution with godaddy.. They said everything are wokring fine in the server.. So, I tried to find a better optimized solution to my problem and I found the XMLReader: 好的,我无法使用godaddy找到任何解决方案。.他们说服务器中的一切都正常。.因此,我试图为我的问题找到更好的优化解决方案,然后我找到了XMLReader:

$reader = new XMLReader();
$reader->open($product_xml_link);
    while($reader->read()) {
        if($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'product' ) {
         //..do the proccess here..whatever you want..
         //for example
         $product = new SimpleXMLElement($reader->readOuterXml());
         $pid = $product->id;
         $name = $product->name;
        ...
        ...
}

There are lots of links that you could read of about XMLReader, which is also better for large XML files.. 您可以阅读许多有关XMLReader的链接,这对于大型XML文件也更好。

Now, I could INSERT all the XML Elements into DB without any 500 internal errors. 现在,我可以将所有XML元素插入DB,而不会出现500个内部错误。 *Although my XML is not to big..about 3.500 products *虽然我的XML不太大..约3.500个产品

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM