I am using Flex 4, Zend & PHP. I created a few php dataservices & modified them to create 1 php file w/ my database connections that will then be used throughout my service calls in flex. I tested my php using just php & everything works fine.
When I test it in Flex, though, I get an error “Make sure that Zend Framework is installed correctly and the parameter “amf.production” is not set to true”.
I’ve tracked it down to the first line in my code below that has an “include” statement…it’s not a php error as the script works in php. What is the workaround for Flex?
<?php
include ( "myConnections.php" ); // flex doesn't like this line
class myCustomClass {
public $conn;
public function __construct() {
$this->conn = new conn();
$this->connection = mysqli_connect(
$this->conn->server,
$this->conn->username,
$this->conn->password,
$this->conn->databasename,
$this->conn->port
);
}
public function myFunction () {
// blah, blah, blah
}
}
?>
If you’re using the Zend framework , you shouldn’t have to use include statements, rather use the Bootstrap file to set your environment.
This being said, are you sure that there isn’t a problem with myConnections.php? Just for debug purposes , have you tried to hardcode your connection values and then test with Flex?