Advertisement

Fatal error: Call to undefined function: file_get_contents()

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Locked
Noddegamra
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Wed Jun 14, 2006 2:12 pm
Location: UK
Contact:

Fatal error: Call to undefined function: file_get_contents()

Post by Noddegamra » Wed Oct 18, 2006 9:33 am

Hello,

I have just unzipped the BETA download contents into a folder on my localhost (everything is setup fine there so don't worry), but when I go to index.php I recieve this error:
Fatal error: Call to undefined function: file_get_contents() in c:\phpdev\www\public\joomla_beta_v1_5\libraries\joomla\utilities\simplexml.php on line 170
Nothing is intalled yet. When I try INSTALL.php instead it just says "restricted access", so I guess I am meant to go to the index file, but I get stuck with this error. As I said, as far as I know everything with my localhost seems setup properly as I have made loads of websites on it. So can anyone please help? I'm sure the solution is simple, but my brain is just a little tired this morning. lol

Advertisement
diri
Joomla! Guru
Joomla! Guru
Posts: 702
Joined: Wed Sep 21, 2005 9:27 am
Location: Somewhere

Re: Fatal error: Call to undefined function: file_get_contents()

Post by diri » Wed Oct 18, 2006 10:08 am

Looks like there's a problem with file permissions. Windows is no good with this (have a similar problem since last patchday) ...

Noddegamra
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Wed Jun 14, 2006 2:12 pm
Location: UK
Contact:

Re: Fatal error: Call to undefined function: file_get_contents()

Post by Noddegamra » Wed Oct 18, 2006 10:25 am

As the site is on my localhost machine and not live (online), every file and folder has 100% full privaleges.

If this site was online it would make sense as some of the Joomla files get created by the server (and therefore the permission is given to the server and not the actual user who does the FTP in some rare case server setups), but as i said everything should be totally writeable, accessable etc.

diri
Joomla! Guru
Joomla! Guru
Posts: 702
Joined: Wed Sep 21, 2005 9:27 am
Location: Somewhere

Re: Fatal error: Call to undefined function: file_get_contents()

Post by diri » Wed Oct 18, 2006 10:30 am

Noddegamra wrote: As the site is on my localhost machine and not live (online), every file and folder has 100% full privileges.
This is no reason for Windows to allow all.  :'(

I have exact the same problem:
To be able to do development when I have time outside of local office I have most important sites mirrored on a USB harddisk. I have exports from i.e. Joomla!'s SVN there as well. Since release of 1.5 beta I'm not able to access export of trunk with web server. This worked very fine before.

Noddegamra
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Wed Jun 14, 2006 2:12 pm
Location: UK
Contact:

Re: Fatal error: Call to undefined function: file_get_contents()

Post by Noddegamra » Wed Oct 18, 2006 10:53 am

why would windows prevent access to an xml file? All previous versions of Joomla (along with many other php and flash sites that included xml files) worked perfectly.

User avatar
Websmurf
Joomla! Hero
Joomla! Hero
Posts: 2230
Joined: Fri Aug 19, 2005 2:23 pm
Location: The Netherlands
Contact:

Re: Fatal error: Call to undefined function: file_get_contents()

Post by Websmurf » Wed Oct 18, 2006 11:04 am

No, not a permission problem.
Call to undefined function
Your server doesn't seem to recognize the function file_get_contents.
That's a default function since php version 4.3.0.

What version is your server running? Are there any functions disabled?
Adam van Dongen - Developer

- Blocklist, ODT Indexer, EasyFAQ, Easy Guestbook, Easy Gallery, YaNC & Redirect -
http://www.joomla-addons.org - http://www.bandhosting.nl

Noddegamra
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Wed Jun 14, 2006 2:12 pm
Location: UK
Contact:

Re: Fatal error: Call to undefined function: file_get_contents()

Post by Noddegamra » Wed Oct 18, 2006 12:43 pm

PHP Version 4.2.3

that must be the problem then  :-[ lol

anyone got any tips on upgrading php etc for phpdev ? Or recommend a better all-in-one php&mysql localhost setup?

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: Fatal error: Call to undefined function: file_get_contents()

Post by ianmac » Wed Oct 18, 2006 12:47 pm

I would recommend XAMPP personally...  I find it works really well, and is fairly easy to set up.  I did some tinkering locally so that the webroot was outside of the program files directory, but it works well either way.

Ian

Noddegamra
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Wed Jun 14, 2006 2:12 pm
Location: UK
Contact:

Re: Fatal error: Call to undefined function: file_get_contents()

Post by Noddegamra » Wed Oct 18, 2006 1:03 pm

Yeah I didn't really like where the files were stored, but I'll try and see if I can set it up like how you explained yours. Sounds good. Thankyou for your help everyone :)

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: Fatal error: Call to undefined function: file_get_contents()

Post by ianmac » Wed Oct 18, 2006 1:15 pm

I just created a new directory (c:\webroot\htdocs) and moved some stuff into webroot that I wanted there, and then I changed the progfiles/xampp/apache/conf/httpd.conf file.

Ian

diri
Joomla! Guru
Joomla! Guru
Posts: 702
Joined: Wed Sep 21, 2005 9:27 am
Location: Somewhere

Re: Fatal error: Call to undefined function: file_get_contents()

Post by diri » Wed Oct 18, 2006 2:28 pm

Remark related to another thread:
I'm sane again in between. :)

Related to this thread and XAMPP some hint:
The recent version you get at sourceforge (i.e. via apachefriends.org) includes all .conf files found in directory conf/extra.

One can always run multiple servers when editing http-vhosts.conf to introduce virtual hosts.

When those hostnames are without entry in DNS one should also edit local file "hosts" in "\system32\etc. Take care to use short names for Windows is very limited in this relation.

Restart Apache after changing something there.

Example from my "mobil development center" (  ;) ):
hosts:
127.0.0.1      localhost edvmobil devmobil

http-vhosts.conf:
NameVirtualHost *:80

    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot I:/xampp/htdocs/edv
    ServerName edvmobil.diri.localnet
    ServerAlias edvmobil
    ErrorLog logs/edvmobil.diri.localnet-error_log
    CustomLog logs/edvmobil.diri.localnet-access_log common



    ServerAdmin webmaster@dummy-host.example.com
##    DocumentRoot I:/joomla/svn/trunk
    DocumentRoot I:/xampp/htdocs/dev
    ServerName devmobil.diri.localnet
    ServerAlias devmobil
    ErrorLog logs/devmobil.diri.localnet-error_log
    CustomLog logs/devmobil.diri.localnet-access_log common


Doing it this way you can assign the servername in your local DNS or a remote DNS (i.e. via dyndns when having dynamic IP) as well as kind of shortcut (ServerAlias) for independent usage without any DNS.

Advertisement

Locked

Return to “Joomla! 1.5 Coding”