title: Class 'SimpleXMLElement' not found
body: <p>I am trying to use digital ocean spaces in my php7 laravel project. The code is pretty simple to just load a file and copy it to the directory. Everything works on my local machine but fails on my digital ocean server with this error </p>
  
  <blockquote>
    <p>Class 'SimpleXMLElement' not found</p>
  </blockquote>
  
  <p>Even on digital ocean server, if I use tinker to run the same storage commands, it works fine. What can be the issue?</p>
  
  <p>My <code>get_loaded_extensions()</code> returns
  get_loaded_extensions()</p>
  
  <pre><code>[
       "Core",
       "date",
       "libxml",
       "openssl",
       "pcre",
       "zlib",
       "filter",
       "hash",
       "pcntl",
       "Reflection",
       "SPL",
       "session",
       "standard",
       "mysqlnd",
       "PDO",
       "xml",
       "apcu",
       "calendar",
       "ctype",
       "curl",
       "dom",
       "mbstring",
       "fileinfo",
       "ftp",
       "gd",
       "gettext",
       "iconv",
       "json",
       "exif",
       "mysqli",
       "pdo_mysql",
       "Phar",
       "posix",
       "readline",
       "shmop",
       "SimpleXML",
       "sockets",
       "sysvmsg",
       "sysvsem",
       "sysvshm",
       "tokenizer",
       "wddx",
       "xmlreader",
       "xmlrpc",
       "xmlwriter",
       "xsl",
       "zip",
       "Zend OPcache",
     ]
  </code></pre>
  
  <p>so it looks like xml and simplexml are installed. As suggested by the <a href="https://stackoverflow.com/questions/35223926/class-simplexmlelement-not-found-on-puphpet-php-5-6">link</a>, <code>php-xml</code> and <code>php-simplexml</code> should be installed. Do I need to install something separately?</p>
  
  <p>Also, my file upload code looks like this</p>
  
  <pre><code>public function uploadNew($file, $title, User $user)
      {
          if (!File::directoryExists($user-&gt;username)) {
              Storage::makeDirectory($user-&gt;username);
          }
          $completeFileName = $user-&gt;username.'/'.$title.time();
          Storage::put($completeFileName, file_get_contents($file), 'public');
          $this-&gt;url = File::baseUrl().$completeFileName;
          $this-&gt;title = $title;
          $this-&gt;user_id = $user-&gt;id;
          $this-&gt;save();
          return $this;
      }
  
      public static function baseUrl()
      {
          return 'https://'.env('DO_SPACES_BUCKET').'.nyc3.digitaloceanspaces.com/';
      }
  
      public static function directoryExists($directory)
      {
          $existingDirs = Storage::directories();
          return in_array($directory, $existingDirs);
      }
  </code></pre>
  
  <p>Adding the stack trace of exception:</p>
  
  <pre><code>(1/1) FatalThrowableError
  Class 'SimpleXMLElement' not found
  in PayloadParserTrait.php (line 39)
  at RestXmlParser-&gt;parseXml(object(Stream))
  in RestXmlParser.php (line 33)
  at RestXmlParser-&gt;payload(object(Response), object(StructureShape), array())
  in AbstractRestParser.php (line 62)
  at AbstractRestParser-&gt;__invoke(object(Command), object(Response))
  in RetryableMalformedResponseParser.php (line 37)
  at RetryableMalformedResponseParser-&gt;__invoke(object(Command), object(Response))
  in AmbiguousSuccessParser.php (line 58)
  at AmbiguousSuccessParser-&gt;__invoke(object(Command), object(Response))
  in GetBucketLocationParser.php (line 30)
  at GetBucketLocationParser-&gt;__invoke(object(Command), object(Response))
  in WrappedHttpHandler.php (line 126)
  at WrappedHttpHandler-&gt;parseResponse(object(Command), object(Request), object(Response), array())
  in WrappedHttpHandler.php (line 93)
  at WrappedHttpHandler-&gt;Aws\{closure}(object(Response))
  in Promise.php (line 203)
  </code></pre>