【问题标题】:Magento - 500 Internal Server Error when making shipment with trackingnumberMagento - 使用跟踪号发货时出现 500 内部服务器错误
【发布时间】:2012-09-28 18:12:03
【问题描述】:

我的 Magento 1.6.2 有问题

当我在另一个后端进行基本装运时,一切正常。

但是当我想添加一个跟踪号码并单击发送 magento 时会显示一个白屏。 Firebug 说:500 内部服务器错误

白屏的网址: /index.php/admin/sales_order_shipment/save/order_id/293/key/KEYNUMBER/

谁能帮帮我? 因为我也想利用这个未来……

更新: 错误日志:

PHP Fatal error:  Call to a member function getStoreId() on a non-object in /var/www/vhosts/liefstoereigenwijs.nl/magento-test/app/code/community/Vianetz/AdvancedInvoiceLayout/Model/Order/Pdf/Shipment.php on line 24
PHP Warning:  spl_autoload(): open_basedir restriction in effect. File(mage.inc) is not within the allowed path(s): (/var/www/vhosts/liefstoereigenwijs.nl/:/tmp/) in /var/www/vhosts/liefstoereigenwijs.nl/magento-test/app/code/core/Mage/Core/functions.php on line 244
PHP Warning:  spl_autoload(): open_basedir restriction in effect. File(mage.php) is not within the allowed path(s): (/var/www/vhosts/liefstoereigenwijs.nl/:/tmp/) in /var/www/vhosts/liefstoereigenwijs.nl/magento-test/app/code/core/Mage/Core/functions.php on line 244
PHP Fatal error:  Class 'Mage' not found in /var/www/vhosts/liefstoereigenwijs.nl/magento-test/app/code/core/Mage/Core/functions.php on line 0

高级发票布局文件的一部分:

<?php
/**
 * AdvancedInvoiceLayout Order Shipment PDF model
 *
 * @category   Vianetz
 * @package    Vianetz_AdvancedInvoiceLayout
 * @author     Christoph Massmann <C.Massmann@vianetz.com>
 * @license    http://www.vianetz.com/license
 */
class Vianetz_AdvancedInvoiceLayout_Model_Order_Pdf_Shipment extends Vianetz_AdvancedInvoiceLayout_Model_Order_Pdf_Abstract
{
    public function getPdf($shipments = array())
    {   
        $this->_beforeGetPdf();
        $this->_initRenderer('shipment');

        $this->pdf = new Zend_Pdf();
        $style = new Zend_Pdf_Style();
        $this->_setFontBold($style, 10);

        foreach ($shipments as $shipment) {
            if ($shipment->getStoreId()) {
                Mage::app()->getLocale()->emulate($shipment->getStoreId());
                Mage::app()->setCurrentStore($invoice->getStoreId());
            }
            $this->page = $this->_newPage($this->pdf, $shipment->getStore());

            $order = $shipment->getOrder();

            Mage::helper('advancedinvoicelayout')->loadConfig($this, $shipment->getStore());

第 24 行是:

Mage::app()->setCurrentStore($invoice->getStoreId());

谁能告诉我怎么了?

【问题讨论】:

  • 500 服务器错误意味着有一个致命的 PHP 阻止了请求完成。检查您的服务器日志。
  • 这是一个商业扩展,因此您应该联系作者 (Vianetz) 并报告错误。 Stack Overflow 无权修复专有代码。此外它在使用之前显然没有分配$invoice,它已经坏了。

标签: php magento internal-server-error


【解决方案1】:

PHP 内存不足,Magento requires at least 256MB。通过创建然后查看显示以下内容的 PHP 文件来检查当前配置的内容:

<?php phpinfo();

Magento 的默认 .htaccess 文件将内存限制设置为 256MB。如果这没有生效,那么您需要修改服务器的 php.ini 文件。如果限制正确,请尝试再增加一点。

【讨论】:

  • 我将它增加到 384mb 仍然没有成功。
  • 对不起。空白页通常是由此引起的。
【解决方案2】:

我已在 Vianetz 提交错误报告。 感谢大家帮助我朝着正确的方向前进。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-20
    • 1970-01-01
    • 2019-03-21
    • 1970-01-01
    • 2016-06-23
    • 2023-03-10
    相关资源
    最近更新 更多