简体   繁体   English

使用PHP脚本将文章上传到Joomla 3.6

[英]Uploading an Article to Joomla 3.6 using a PHP Script

For the past years we have used a local application that uploads articles to our Joomla homepage (Using a PHP Script). 在过去几年中,我们使用了一个本地应用程序将文章上传到我们的Joomla主页(使用PHP脚本)。 After the latest update to Joomla 3.6 (Used to be 3.5) that application no longer works. 在Joomla 3.6(以前是3.5)的最新更新之后,该应用程序不再有效。 The following error occurs: 发生以下错误:

Error displaying the error page: Application Instantiation Error: Failed to start the session because headers have already been sent by "/var/www/DOMAIN/htdocs/FOLDER/execute.php" at line 1.

There used to be an "application.php" file inside ./htdocs/FOLDER/administrator/includes/ and after the update the file disappeared. 曾经有./htdocs/FOLDER/administrator/includes/中的“application.php”文件,更新后文件消失了。 It looks like the script can't create an instance of the application. 看起来脚本无法创建应用程序的实例。 I have already tried to repair the Database using the Back End option, but that didn't solve the problem. 我已经尝试使用Back End选项修复数据库,但这并没有解决问题。

Update: The above error occurs at: 更新:上述错误发生在:

$mainframe = JFactory::getApplication('administrator'); 

Help is much appreciated! 非常感谢帮助!

Some text is being output by "/var/www/DOMAIN/htdocs/FOLDER/execute.php", probably white space at line one. 一些文本由“/var/www/DOMAIN/htdocs/FOLDER/execute.php”输出,可能是第一行的空白区域。 Check nothing is output before sending any headers. 在发送任何标头之前检查没有输出。

Not a great resolution but you could also clean the output buffer before the header fn. 分辨率不是很高,但你也可以在标题fn之前清理输出缓冲区。 Have a read of ob_clean() 读一读ob_clean()

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

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