I am trying to do a clean install of D7 on an ArchLinux machine. This machine has all the latest updates installed.

PHP 5.3.5 is installed and working -- I can view the test.php page with no problems from a browser window.

When I try to run the D7 install.php script I get a blank screen. Checking the apache log, I find:

"PHP Fatal error: Call to undefined function json_encode() in /srv/http/drupal/includes/common.inc on line 4797."

According to the test.php output, json support is enabled in php and I can find the json.so library in the php installation.

Any ideas would be appreciated.


Dave Riedel


lorinpda’s picture

Hi Dave,
I am also a big Arch Linux fan. I've got several versions of Drupal running under the same environment you describe.

Try this:
Edit the .htaccess file (note! it's a hidden file and you need to edit the file with a text editor like vi, nano, kate, etc). Change the following line fro:

Options -Multiviews


#Options -Multiviews

In other words just comment that line out. Should work.

The .htaccess file is located in the root directory of your Drupal 7 installations.

I'll monitor your reply. Please let me know if that helps :)

We build online communities

dpriedel’s picture

What I found to be the apparent problem is that I needed to enable the pre-loading of the json extension in the php.ini file.

I made that change and the install screen came up.

I looked at the .htaccess file and I'm not familiar with the syntax but I interpret that line to be disabling Mutliviews so
commenting it out would leave them enabled (unless they are turned off somewhere else) and the comment
says they are not needed for Drupal.



lorinpda’s picture

Hi Dave,
You are correct, the json.so needs to be enabled in the php,ini. However, you don't need the "Multiviews:", the comment in the ,htaccess file says:

Multiviews creates problems with aliased URLs and is not needed for Drupal.

If your installation is working, that's great no need to change.

I just wanted to make sure other folks who find this post get the correct info. Folks who have Drupal 6 installations running under Arch Linux will find that by commenting out the line I described, they can also run (and install) Drupal 7.

In other words, the Multiviews statement is a new directive added with Drupal 7. The statement attempts to enable that feature. On my Arch Linux boxes, that statement prevented the installation routine from running, Commenting out that statement allowed me to install Drupal 7.

We build online communities

dpriedel’s picture

I believe that line in .htaccess -is- disabling Multiviews -- it is "Options -Multiviews" or, as I read it, "Options minus Multiviews"

so that commenting it out actually leaves them enabled.



onegreypaw’s picture

For what it's worth, I too was getting the "Call to undefined function json_encode()..." error. I was on Netfirms, upgrading D7.12 - D7.14 via their SimpleScripts interface (sad times). For some reason the actual "/includes/json-encode.inc" file was entirely missing from the directory. So, if nothing else, make sure the file exists. I uploaded the file from another D7.14 install and voila, back online.