Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,008
    Thanks
    59
    Thanked 10 Times in 10 Posts

    php.ini runtime modiyfing

    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
    C:\Users\Nikos\Documents\Computing\htdocs\ecommercetotal\ecommercetotal.co.uk


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

    Code:
    Warning:  require_once(Zend/Amf/Server.php) [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]: 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

    Code:
    include_path.;C:/Program Files/EasyPHP 2.0b1\php5\pear\.;C:/Program Files/EasyPHP 2.0b1\php5\pear\
    and the framework s housed at:
    C:\Users\Nikos\Documents\Computing\htdocs\ecommercetotal\frameworks

    my web root is:

    C:\Users\Nikos\Documents\Computing\htdocs\

    Any advice would be great


  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Try this:
    PHP Code:
    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!
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #3
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,008
    Thanks
    59
    Thanked 10 Times in 10 Posts
    Thanks for your help.

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

    PHP Code:
    <?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();
    $server->setClass("Tutorials");

    echo(
    $server->handle());?>
    I get a untitled page with no URL that asks me to download
    zend-test.php?


  • #4
    Senior Coder nikos101's Avatar
    Join Date
    Dec 2006
    Location
    London
    Posts
    1,008
    Thanks
    59
    Thanked 10 Times in 10 Posts
    I've followed this tutorial 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"?>
    <services-config>
    <services>
    <service id="amfphp-flashremoting-service" class="flex.messaging.services.RemotingService" messageTypes="flex.messaging.messages.RemotingMessage">
    <destination id="zend">
    <channels>
    <channel ref="my-zend"/>
    </channels>
    <properties>
    <source>*</source>
    </properties>
    </destination>
    </service>
    </services>
    <channels>
    <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"/>
    </channel-definition>
    </channels>
    </services-config>


  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    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?
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •