jenssegers / php-proxy

A PHP proxy script with https and post support
https://jenssegers.com
933 stars 266 forks source link

Class ServerRequestFactory not found #61

Closed sleeyax closed 5 years ago

sleeyax commented 5 years ago

Using the example in the readme I get Fatal error: Uncaught Error: Class 'Zend\Diactoros\ServerRequestFactory' not found.

This issue has been opened several times before (see https://github.com/jenssegers/php-proxy/issues/40 and https://github.com/jenssegers/php-proxy/issues/51) but none of the suggested solutions worked for me. So please update the readme...

sleeyax commented 5 years ago

Nevermind, I just forgot to add the composer autoloader 😅

themobi commented 5 years ago

Nevermind, I just forgot to add the composer autoloader

me too :rofl:

colthreepv commented 4 years ago

it could be useful to fix the example usage on homepage

srujandeshpande commented 4 years ago

@sleeyax It's my first time working with PHP and I'm not too sure how to go about as I've got the same error. Could you please tell me what to do or direct me in the right direction?

sleeyax commented 4 years ago

@sleeyax It's my first time working with PHP and I'm not too sure how to go about as I've got the same error. Could you please tell me what to do or direct me in the right direction?

Add require_once 'vendor/autoload.php'; at the top of your PHP file. Check the composer docs about autoloading for more info.