1 person found this helpful
1. Have you changed the endpoint url in the generated code for your service to point to the production server?
2. Have you copied the amf_config.ini and changed it accordingly?
1 person found this helpful
Just need one more added info.
Are you trying to use this PHP project created using FB3 in FB 4?
If so, can you please try doing the following steps:
1.In FB4 using DCD Feature create the PHP Service.
2.Then export the release build.
3.Import the release build and take care of the following points:
1. install zend framework
2. change the endpoint url w.r.t server settings
3. place the services under the server location in the same path as it was during the service creation
4. update the amf_config.ini file
Please let us know if it helps!
Thanks for the reply. I'm using the PHP code automatically generated by FB 4, which I altered slightly with my database information. I did copy over the .ini file and updated the path to point to the Zend folder, but I don't think I changed the endpoint. Would that be in the gateway.php file?
The endpoint would be the in the mxml file as part of the generated code. If you have used the service using the "Bind To Data" dialog, It would be part of the declarations tag in the mxml file as shown below.
<YourService :YourService id="YourService" destination="YourService" endpoint="http://localhost/YourProject-debug/gateway.php" fault="Alert.show(event.fault.faultString)" showBusyCursor="true" source="yourService"/>
The localhost needs to be changed to the server, where you are deploying your swf.Also the YourProject-debug folder to the directory under the webroot where you have copied the swf files and the corresponding php files.
Hope this helps.
Actually I hadn't done that. The endpoint was still set to localhost. I updated that and now I see when I launch the app it is trying to connect to my site instead of localhost. I still get the 'send failed' message though, so I must have something else wrong as well. I keep trying to update the path to the ZendFramework folder in either the gateway.php file, or the amf_config.ini file thinking that is the problem, but so far no luck.
I've tried setting
in the amf_config.ini file, which is in the same folder as the gateway.php file. I have the 'ZendFramework' folder in a folder called 'Frameworks' which is in the top-most level folder of my site.
If you see the code in gateway.php, the first few lines look like this
//default zend install directory
$zenddir = $_SERVER['DOCUMENT_ROOT']. '/ZendFramework/library';
//Load ini file and locate zend directory
$zenddir = $arr['zend']['zend_path'];
There are 2 options to set zenddir here
1. uncomment the zend_path in amf_config.ini to the actual location on the server, for example c:\webroot\Framworks\ZendFramework\library OR
2. change the $zenddir as given in the first line in the snippet of gateway.php
Option 1 is recommended as amf_config is a config file and that is what that should be modified.
I've tried that all different ways, but still all I get is 'send failed'. I'll go back to the beginning and try again, I guess it must be something else. Thanks again.
Thanks Mayank, that was helpful.
I just cannot get this work though. I'm giving up for now, I'll wait until that 'export release workflow' you mentioned is ready. Thanks.
Trying one more thing, I try to run the file gateway.php, just to see what happens and I get the message below:
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /Frameworks/ZendFramework/library/Zend/Loader/Autoloader.php on line 40
This makes me think that the configuration is right, because it can find this autoloader.php file, but perhaps my web hosting company does not support the appropriate version of PHP. Does that sound plausible to anyone?
Yes, this error occurs if you have a php version below php5 on your server.
Only versions over PHP5 are supported.