Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PHP



I am trying to get PHP's ftp functions to work. I tried to run the example
ftp PHP page located at: http://www.php.net/manual/en/ref.ftp.php and I got
the error:
Fatal error: Call to undefined function: ftp_connect() in
/Library/WebServer/Documents/index.php on line 5

In the notes for the FTP functions it states "In order to use FTP functions
with your PHP configuration, you should add the --enable-ftp option when
installing PHP 4, and --with-ftp when using PHP 3."

Perhaps if this flag was not set this is why my ftp pages are not working.
I did not install php it came pre-instaled on my mac os x. So I have no idea
if this flag was set or not. Is there a way I can check for, or set the
flag?



Thanks,
Adam



Index.php:
<html><head><title>PHP Test</title></head>
<body>
<?php
// set up basic connection
$conn_id = ftp_connect("63.69.88.12");

// login with username and password
$login_result = ftp_login($conn_id, "test", "test");

// check connection
if ((!$conn_id) || (!$login_result)) {
echo "FTP connection has failed!";
echo "Attempted to connect to $ftp_server for user $ftp_user_name";
die;
} else {
echo "Connected to $ftp_server, for user $ftp_user_name";
}
// close the FTP stream
ftp_close($conn_id);
?>
</body></html>
_______________________________________________
macos-x-server mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macos-x-server
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.