I am migrating a Drupal site from my localhost to the most current Bitnami Drupal AMI on Amazon:

  • I uploaded the DB successfully.

  • I moved the files correctly.

  • I copied over the modules and libraries.

I got the WSOD, changed the error reporting and now, upon opening the site I get:

    Fatal error: require_once(): Failed opening required 
(include_path='.:/opt/bitnami/php/lib/php') in 
/opt/bitnami/apps/drupal/htdocs/includes/bootstrap.inc on line 3066

But the file is in the proper spot, within the structure outlined by Bitnami:


How do I convince drupal (or php) to use "/home" instead of "/opt"? I suppose I could just try a symlink but... that seems like such a kludge. I'd like to do it the "right" way.

Any suggestions?

  • Maybe a simple symlink is all it takes. – leymannx Mar 20 '19 at 15:18

If your files are all under /home instead of /opt you could just setup a virtualhost and point to the /home docroot

e.g, for apache, where www.example.com is your site domain name:

<VirtualHost *:80>
     ServerName www.example.com
     DocumentRoot /home/bitnami/apps/drupal/htdocs
     CustomLog /var/log/apache2/example-access.log combined
     ErrorLog  /var/log/apache2/example-error.log          

     php_value memory_limit 256M
     php_value upload_max_filesize 128M
     php_value post_max_size 128M      
     php_value max_execution_time "360"

     FileETag ALL

     <Directory /home/bitnami/apps/drupal/htdocs>
         RewriteEngine on                
         RewriteBase /                   

         RewriteCond %{REQUEST_FILENAME} !-f
         RewriteCond %{REQUEST_FILENAME} !-d
         RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

         Options -Indexes
         AllowOverride All

         # Follow symbolic links in this directory.
         Options +FollowSymLinks                   

         # Customized error messages.
         ErrorDocument 404 /index.php

         # Set the default handler.
         DirectoryIndex index.php  

         php_value magic_quotes_gpc                0
         php_value register_globals                0
         php_value session.auto_start              0
         php_value mbstring.http_input             pass
         php_value mbstring.http_output            pass
         php_value mbstring.encoding_translation   0   

         # Requires mod_expires to be enabled.
         <IfModule mod_expires.c>             
             # Enable expirations.            
             ExpiresActive On                 
             # Cache all files for 2 weeks after access (A).
             ExpiresDefault A1209600                        
             # Do not cache dynamically generated pages.    
             ExpiresByType text/html A1                     
         <IfModule mod_deflate.c>                           
         # Use mod_deflate to compress text content as required and supported by the client
         # Note that the frontend will automatically gzip content if supported using PHP functionality
         AddOutputFilterByType DEFLATE text/html text/javascript text/css application/x-javascript    



<VirtualHost *:80>
    # Redirect non-www to www version of site
    ServerName example.com
    Redirect permanent / http://www.example.com/

Add to /etc/apache2/sites-available/example.conf

Then, to enable:

sudo a2ensite example.conf
sudo service apache2 restart

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.