Installation/Creating your first application
Archived from the Xataface Users forum.
chm — Sat Aug 08, 2009 6:51 am
Hi everybody
I am posting for the first time here.
Steve, first of all: This is a fantastic piece of software; very good idea and obviously very well done! Thanks for sharing with us!
I played around with Xataface on my local machine and everything worked perfectly.
However I run into some problems when I tried to create applications on a shared hosting (I tried 3 different servers). Everything is fine when I am pointing to dataface/dataface_info.php (“Installed correctly”).
Now, pointing to index.php it says:
Warning: require_once() [function.require-once.php]: URL file-access is disabled in the server configuration in /home/domain/public_html/folder/index.php on line 2
Warning: require_once(http://www.domain.com/folder/xataface/d … ic-api.php) [function.require-once.php]: failed to open stream: no suitable wrapper could be found in /home/domain/public_html/folder/index.php on line 2
Fatal error: require_once() [function.require.php]: Failed opening required ‘http://www.domain.com/folder/xataface/dataface-public-api.php’ (include_path=’.:/usr/local/lib/php’) in /home/domain/public_html/folder/index.php on line 2
My index.php looks like this:
- Code: Select all
require_once 'http://www.domain.com/folder/xataface/dataface-public-api.php'; df_init(__FILE__, 'http://www.domain.com/folder/xataface'); $app =& Dataface_Application::getInstance(); $app->display();
What am I doing wrong? Or are there already at this stage some server side PHP restrictions involved?
mikep — Sun Aug 09, 2009 10:29 pm
Hey,
Have you tried looking in your web server’s error log?
You also might try changing the path for the “require_once” line to the absolute path in your file system (i.e. /srv/www/htdocs/xataface/dataface-public-api.php, this varies based on your OS and which web server you’re running). Thats how it is in both of my installations.
Mike
chm — Mon Aug 10, 2009 2:59 am
mikep,
that was it! So simple, I just adjusted the path to the server’s file system…
I am really sorry for bothering you with this!
Now it works, although I only get a very basic site, just white and some links. Obviously it doesn’t load the css style sheet.
Could you get me a second hint?
Many thanks in advance!
mikep — Mon Aug 10, 2009 7:23 am
Hey,
That usually happens when the df_init(__FILE__, line has the incorrect url. For instance if you have ‘http://localhost/folder/xataface’ in your index.php file and try to access http://www.domain.com/folder/xataface/index.php from your web browser.
Mike
chm — Mon Aug 10, 2009 9:31 am
Brilliant!
Now it works. Obviously as a non programmer I got a little confused about the different paths.
In case somebody is stumbling as well in the future and is looking in the forum:
index.php
* require_once needs the absolute path of your server’s file system (in my case it was: ‘/home/user/public_html/folder/xataface/dataface-public-api.php’)
* df_init(__FILE__, needs the url of your xataface installation (e.g. ‘http://www.domain.com/folder/xataface’)
mikep, many thanks for your help!
shannah — Mon Aug 10, 2009 10:32 am
In case somebody is stumbling as well in the future and is looking in the forum:
index.php
* require_once needs the absolute path of your server’s file system (in my case it was: ‘/home/user/public_html/folder/xataface/dataface-public-api.php’)* df_init(__FILE__, needs the url of your xataface installation (e.g. ‘http://www.domain.com/folder/xataface’)
Just want to make a comment this you can also use relative paths for these. E.g.
- Code: Select all
require_once 'xataface/dataface-public-api.php'; df_init(__FILE__, 'xataface');
But absolute paths are fine too.
The Xataface installer uses absolute paths because it may not have complete knowledge of where your application will end up.
Both ways are fine.