Wow. This is painful to watch from this vantage point. First I shall attack the
Warning: require_once(/Yumanity/test/dataface-public-api.php) [function.require-once]: failed to open stream: No such file or directory in
errors.
This error means that you have the wrong path (i.e. the file /Yumanity/test/dataface-public-api.php does not exist). Indeed this path looks unlikely to exist because your Yumanity folder likely resides inside a parent folder like /home/xyz/.. etc..
If you want to find the definitive path, you can log in via command line FTP and issue the command 'pwd'.
Here is a small readout of me logging into an FTP server and findout out the path to my home directory:
- Code: Select all
stevepbook:~ shannah$ ftp css.css.sfu.ca
Connected to css.css.sfu.ca.
220 css FTP server (SunOS 5.8) ready.
Name (css.css.sfu.ca:shannah): shannah
331 Password required for shannah.
Password:
230 User shannah logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
Remote directory: /home/fas/shannah
ftp>
Trying random permutations of paths will get you frustrated and likely result in no success.
Setting up Xataface is trivial if you have a grasp of
a. The directory structure of your server.
b. Your server's MySQL Login details.
I suggest trying a couple of exercises first to get you familiar with these things.
Exercise 1: Include one PHP file in another.
Steps:
Create a directory somewhere on your server called 'helloworld'.
Create a file within helloworld called 'hello.php' with the contents.
- Code: Select all
<?php
echo 'Hello world';
Create another directory somewhere else on your server called 'hellopages'.
Create a file within hellopages called index.php with the following contents:
- Code: Select all
<?php
require_once '/path/to/helloworld/hello.php';
Where '/path/to/helloworld' is the absolute path to your helloworld folder on your server.
Then point your web browser to
http://yourdomain.com/path/to/hellopages/index.php(i.e. the URL to your hellopages page).
Note that the /path/to/hellopages path in this url is relative to your document root, whereas the '/path/to/helloworld' from the index.php file is an absolute path from the root of your file system.
If everything works then you should see "hello world". Otherwise you'll get an error.
If you get an error, that means you have the path wrong in your index.php file. One tool you can use to find the correct path is to call the phpinfo() function in your PHP file and then load the page. This will show you all of the environment information.
e.g. Create a file named phpinfo.php with the contents:
- Code: Select all
<?php
phpinfo();
Then load the page in your web browser. The Document Root setting will show you the path to your web server's document root. Likely all other files you have placed on your server are relative to this value.
Do not proceed until you can get this exercise working because any attempts to get any other scripts working will be futile unless you can master this exercise.
Exercise 2: Database connection
In this exercise you will create a database on your web server and try to connect to it.
Steps:
1. Create a new database using whatever database tools your host provides, named 'helloworld'.
2. Create a file on your web server called 'hellodb.php' with the following contents:
- Code: Select all
<?php
$db = mysql_connect('HOST', 'USERNAME', 'PASSWORD');
if ( !$db ) die("Failed to connect to database: ".mysql_error());
$res = mysql_select_db('helloworld', $db);
if ( !$res ) die("Failed to select database: ".mysql_error());
echo "Connected successfully!";
But replace 'HOST' with the host name of your database (usually 'localhost', but may be different - check instructions from your web host for the proper host name); And replace USERNAME and PASSWORD with the username and password that you have been supplied with to connect to the MySQL server (it should say this somewhere in your web host information).
Step 2: Point your web browser to this page (hellodb.php). If you receive an error, note the error and try to make changes accordingly until you see the text "Connected successfully" on the screen.
Once you have successfully completed these two exercises you are ready to proceed to creating a xataface application. If you cannot master these two exercises then attempts to create a xataface application will be futile.
Best regards
Steve