Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6334963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:45:43+00:00 2026-05-24T18:45:43+00:00

I currently have a very simple news system that reads in RSS from a

  • 0

I currently have a very simple news system that reads in RSS from a local file using DOMDocument->load(). In addition there is a very simple back end that adds items to the loaded feed and saves it back using DOMDocument->save().

This works fine on my testing server, but when deployed to the client the save operation fails with a 500 error. I think this is due to limitations they have in place which also prevent use of fopen and file_get_contents, although I’m confused by how I can load the XML fine, but not save it back again.

So really I have two questions (naughty, I know):

  1. Does DOMDocument’s save method differ substantially from load, and what is the underlying technique used to write the file?
  2. How would I go about saving a DOMDocument object as XML using cURL (because I know cURL is permitted)?

For what it’s worth, here is a truncated version of the load/save:

//load the xml
$doc = new DOMDocument();
$doc->load($_SERVER['DOCUMENT_ROOT'].'/news_rss.xml');
$doc->formatOutput = true;
//add some stuff to the xml ...

//save it again
$doc->save($_SERVER['DOCUMENT_ROOT'].'/news_rss.xml');
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:45:44+00:00Added an answer on May 24, 2026 at 6:45 pm

    curl and dom don’t have much to do with each other. Curl just fetches a specified resource (or sends data to a resource). DOM parses xml/html trees. The fact that you can point dom at a particular URL and get that url’s contents is a byproduct of PHP’s file-based functions allowing URLs.

    There’s no link between DOM and CURL, so you can’t have DOM invoke curl to fetch/save for you. You’d have to use CURL to fetch some resource and save it into a temporary file (or a variable), then use that file/variable as a source in DOM. The same goes vice version – DOM cannot invoke curl to save a file.

    Given that your load/save calls aren’t using URLs (just a local file path), I’d check permissions on the news_rss.xml file. Generally most files on a system are readable by everyone, but not everyone has write permissions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple case that I think would benefit from using templates
I currently have a very simple intranet that we are using for some basic
I have a (currently very simple) website that is utilising Facebook's Website with Facebook
What I have currently is a very simple div that has a flexcroll scroll
I have a very simple terminal application that sens and receives characters from a
I currently have a Content Type called News which is very simple (No custom
Currently I have a very simple tab system set up, the problem is when
I currently have a very simple MySQL database (articlesDB) with 1 table (articles) and
Very simple + silly question: Does clojure provide multi maps? I currently have something
I have a very simple interface which needs to communicate between processes. It's currently

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.