View Full Version : php.ini runtime modiyfing

12-12-2008, 11:37 PM
I have a page that has this code in it:

ini_set("include_path", ini_get("include_path") . ":../frameworks");

require_once 'Zend/Amf/Server.php';

this page location is

But when I run the page:
I'm getting errors:

Warning: require_once(Zend/Amf/Server.php) [function.require-once (http://localhost/ecommercetotal/ecommercetotal.co.uk/function.require-once)]: failed to open stream: No such file or directory in C:\Users\Nikos\Documents\Computing\htdocs\ecommercetotal\ecommercetotal.co.uk\zend-test.php on line 6

Fatal error: require_once() [function.require (http://localhost/ecommercetotal/ecommercetotal.co.uk/function.require)]: Failed opening required 'Zend/Amf/Server.php' (include_path='.;C:/Program Files/EasyPHP 2.0b1\php5\pear\:../frameworks') in C:\Users\Nikos\Documents\Computing\htdocs\ecommercetotal\ecommercetotal.co.uk\zend-test.php on line 6
The php.ini file looks like this

include_path.;C:/Program Files/EasyPHP 2.0b1\php5\pear\.;C:/Program Files/EasyPHP 2.0b1\php5\pear\and the framework s housed at:

my web root is:


Any advice would be great :)

12-13-2008, 06:33 AM
Try this:

ini_set("include_path", ini_get("include_path") . ";" . realpath("../frameworks"));

I'm thinking that it may be trying to detect relative to the ini file, which of course is the incorrect path. I don't know if this would log an error or not, but you could check you're error logs (try restarting apache and seeing then; it should happen on php module load).
Don't forget that on Windows servers it likes the semi-colon. There is a way to detect this, I think its under the ini directive path_separator (play around with it or check the api, sounds about right).
Post back with results!

12-15-2008, 08:44 PM
Thanks for your help.

Now when I run the page
zend-test.php which contains:

<?php error_reporting(E_ALL|E_STRICT);
ini_set("display_errors", "on");

//ini_set("include_path", ini_get("include_path") . ":../frameworks");
ini_set("include_path", ini_get("include_path") . ";" . realpath("../frameworks"));
require_once 'Zend/Amf/Server.php';
require_once 'Tutorials.php';

$server = new Zend_Amf_Server();


I get a untitled page with no URL that asks me to download

12-15-2008, 11:29 PM
I've followed this tutorial (http://corlan.org/2008/11/13/flex-and-php-remoting-with-zend-amf/)and managed to get this all working locally.

However if I want to upload this to my server I guess I need to change some things? Things like the services_config.xml file in flex?

<?xml version="1.0" encoding="UTF-8"?>
<service id="amfphp-flashremoting-service" class="flex.messaging.services.RemotingService" messageTypes="flex.messaging.messages.RemotingMessage">
<destination id="zend">
<channel ref="my-zend"/>
<channel-definition id="my-zend" class="mx.messaging.channels.AMFChannel">
<endpoint uri="http://localhost/ecommercetotal/ecommercetotal.co.uk/zendamf_remote/" class="flex.messaging.endpoints.AMFEndpoint"/>

12-16-2008, 01:44 AM
Flex eh? I hate that >.<
It looks like (without going into code or anything) that the Zend amf server is a type of web service. That being said, what you'll need to modify is you're endpoint uri, just like in wsdl. It needs to point at the location of the serving file, which in this case is whatever file runs the $obj->handle() method.

Sadly, I don't know anything else about this amf framework though. Has the path includes fixed themselves with the changes though?