简体   繁体   English

Smarty中有500个内部服务器错误?

[英]500 Internal Server Error in Smarty?

I got 500 Internal Server Error. 我收到500内部服务器错误。 I fetch the data from mysql using php file and assign a Smarty variable, and printing in tpl file. 我使用php文件从mysql获取数据并分配Smarty变量,并在tpl文件中打印。

There are 23k data records. 有23k的数据记录。 If I echo (printing all value) in PHP file I get all data. 如果我在PHP文件中回显(打印所有值),我将获得所有数据。 but while loading in smarty it through 500 error. 但通过500错误加载smarty它。 while loading the tpl file in Smarty. 在Smarty中加载tpl文件时

I checked access.log, error.log files and does not show any error. 我检查了access.log,error.log文件,但没有显示任何错误。 I checked many solution but all are fails. 我检查了很多解决方案,但都失败了。

You have 23k data records in one folder? 您在一个文件夹中有23k数据记录?

While printing all values in PHP but while loading "500 internal server error "? 在PHP中打印所有值但在加载“500内部服务器错误”时?

Solution : It's due to PHP's maximum execution timeout and memory usage. 解决方案 :这是由于PHP的最大执行超时和内存使用量。 Just increase the values in your php.ini as you need. 只需根据需要增加php.ini的值即可。

Enable the Output buffering too... 启用输出缓冲...

max_execution_time = 300 ; //5mins max increase as per your need
memory_limit = 256M ; //Maximum amount of memory a script may consume (256MB)

That's all, if it shows the error again, increase the values. 这就是全部,如果它再次显示错误,则增加值。

But I recommend this method to output the 23k data records: 但我建议这种方法输出23k数据记录:
Just create a table in MySQL, insert all the 23k data, and retrieve it. 只需在MySQL中创建一个表,插入所有23k数据,然后检索它。 This is the finest method and faster that avoids PHP variable stitching. 这是最好的方法,更快,避免PHP变量拼接。

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

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