thecodingmachine / mouf

The Mouf PHP framework: an open-source PHP framework providing an easy way to download, install, use and reuse components, with a graphical user interface.
MIT License
54 stars 28 forks source link

Error on install #76

Closed FloSeas closed 10 years ago

FloSeas commented 10 years ago

I'm trying to troubleshoot installation i have this error during mouf installation, invastigationg on what could be the cause.

Pretty new to framework. If you already have the kind of error...

I'm on ubuntu

Fatal error:  Uncaught exception 'Exception' with message 'An error occured: Empty reply from server' in /-/vendor/mouf/mouf/src/Mouf/Reflection/MoufReflectionProxy.php:285
Stack trace:
#0 /-/vendor/mouf/mouf/src/Mouf/Reflection/MoufReflectionProxy.php(201): Mouf\Reflection\MoufReflectionProxy::performRequest('http://salles-c...')
#1 /-/vendor/mouf/mouf/src/Mouf/MoufClassExplorer.php(69): Mouf\Reflection\MoufReflectionProxy::getClassMap(false)
#2 /-/vendor/mouf/mouf/src/Mouf/MoufClassExplorer.php(193): Mouf\MoufClassExplorer->analyze()
#3 /-/vendor/mouf/mouf/src/Mouf/Moufspector.php(35): Mouf\MoufClassExplorer->getClassMap()
#4 /-/vendor/mouf/mouf/src/direct/get_validators_list.php(72): Mouf\Moufspector::getComponentsList('Mouf\Validator\...', false)
#5 {main}
  thrown in /-/vendor/mouf/mouf/src/Mouf/Reflection/MoufReflectionProxy.php on line 285
FloSeas commented 10 years ago

With further invastigation seams that the request was performed over http but i'm on a https scheme.

I'll look up if i can imporve scheme dectection

FloSeas commented 10 years ago

Although, i Tweaked a bit the vendor and saw that i can also access my generated url but the porte detected was 403 ans i was on 80. So i just write it for my purpose dicrectily in code as I work on cloud9.

on a ubtuntu vm machine. and then I call the genreated url into my web browser and the response is ok.

Further more i get another Exception About unserializing. But i tried on an aline unserializer to deserialyse the code and it when good.

When i deactivate exception for my purpose in vendor it dont work either step 1 pass but step2 don't

moufmouf commented 10 years ago

Hi!

Ok, a mix between https and http might be the source of the problem.

Just to be sure I understand, you are accessing Mouf via an HTTPS url, right? Your HTTPS port is the standard 443 port and you also have a HTTP port on port 80? Or is the only port open the HTTPS one?

Mouf is performing a lot of requests via Curl on itself and we have already faced problems where Mouf cannot call itself. Just give me as much details possible about your setup and I'll try to reproduce the problem.

FloSeas commented 10 years ago

Just wait a moment i have an idea.

(for info i tried both http and https). But maybe it's another problem, i'll do some tests and come back to you

FloSeas commented 10 years ago

Re, yeah i'm accessing trought https, but the https scheme is not detected but the port it right detected 443.

The url requested buy mouf is look like 'http://.....:443/...

FloSeas commented 10 years ago

And my tests did not work

moufmouf commented 10 years ago

ok, I get it. Just give me a few minutes, I'll check it.

moufmouf commented 10 years ago

Mmmmm... this is getting weird... The code that detects whether we are in HTTPS or HTTP is here:

https://github.com/thecodingmachine/mouf/blob/2.0/src/Mouf/Reflection/MoufReflectionProxy.php#L331-L336

The getLocalUrlToProject method should return the URL to Mouf (so that Mouf can call the URL using Curl).

If this method is failing, it means that $_SERVER['HTTPS'] is empty. Any idea why it might be empty? Is the HTTPS decoding perfomed by Apache or are you using some kind of appliance in front of Apache that does the HTTPS decoding?

FloSeas commented 10 years ago

Yep was checking this class too

moufmouf commented 10 years ago

Just pushed a fix. Can you update and let me know if it works?

FloSeas commented 10 years ago

According to http://stackoverflow.com/questions/10951325/how-can-serverhttps-be-empty-when-accessing-over-https.

Setting the env vars in conf resolve the first problem of https empty

FloSeas commented 10 years ago

But stiil buggy

FloSeas commented 10 years ago

ok need to add explicitly

SetEnv HTTPS on

for the first part of the problem

FloSeas commented 10 years ago

next message

Fatal error:  Uncaught exception 'Exception' with message 'Unable to unserialize message:

<br/>URL in error: <a href='https://-/vendor/mouf/mouf/../../../vendor/mouf/mouf/src/direct/get_class_map.php?selfedit=false'>https://-/vendor/mouf/mouf/../../../vendor/mouf/mouf/src/direct/get_class_map.php?selfedit=false</a>' in /home/ubuntu/workspace/vendor/mouf/mouf/src/Mouf/Reflection/MoufReflectionProxy.php:207
Stack trace:
#0 /home/ubuntu/workspace/vendor/mouf/mouf/src/Mouf/MoufClassExplorer.php(69): Mouf\Reflection\MoufReflectionProxy::getClassMap(false)
#1 /home/ubuntu/workspace/vendor/mouf/mouf/src/Mouf/MoufClassExplorer.php(193): Mouf\MoufClassExplorer->analyze()
#2 /home/ubuntu/workspace/vendor/mouf/mouf/src/Mouf/Moufspector.php(35): Mouf\MoufClassExplorer->getClassMap()
#3 /home/ubuntu/workspace/vendor/mouf/mouf/src/direct/get_validators_list.php(72): Mouf\Moufspector::getComponentsList('Mouf\Validator\...', false)
#4 {main}
  thrown in /home/ubuntu/workspace/vendor/mouf/mouf/src/Mouf/Reflection/MoufReflectionProxy.php on line 207

I deleted the domaine name for confidentiality
FloSeas commented 10 years ago

My url was not accessible from mouf

FloSeas commented 10 years ago

sory for disturb and ty for help