ZS 9 on Mac OS 10.11.5 - Problems with random_bytes, SOAP

General discussion forum for the Zend Server
marc501
Posts: 5
Joined: Tue Jul 12, 2016 7:47 pm

ZS 9 on Mac OS 10.11.5 - Problems with random_bytes, SOAP

Post by marc501 » Tue Jul 12, 2016 8:10 pm

Hi,

currently our developers are using Zend Studio 13.5 and a local stack installed with Homebrew (PHP7, Nginx, MySQL).

Now I'm thinking of deploying Zend Server to the developer machines (all on Mac OS recent versions) and so I've downloaded and installed a trial version of new Zend Server 9.

But I've 2 problems, one annoying and one showstopper, that I can't work out and therefore asking for some help.

The major problem:
It seems that ZendServer is not capable of reading /dev/urandom. If php function "random_bytes" is called there is only a warning thrown
Warning: Cannot open source device in /script/path/....
and no random data is delivered. If I stop ZendServer and fire up the "Homebrew-Stack" everything goes fine. So I assume /dev/urandom is readable and the problem is in ZendServer.

The annoying problem:
If I change something in PHP-Config and restart Server over GUI afterwards no SOAP-Calls can be made. All failing with error message
[12-Jul-2016 20:58:37 Europe/Berlin] PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://WSURL' : failed to load external entity
. Going into console and restarting ZendServer with zendctl (not allowed to use the full scriptname here?!?) restart and everything is working fine again until next restart over GUI.

Additional question:
When starting or restarting ZendServer with zendctl (Script shipped with ZendServer) I'm getting the following warning:
chmod: /usr/local/zend/gui/lighttpd/tmp/php-fastcgi.socket: No such file or directory
If I look in the directory there is php-fastcgi.socket-0 created. So obviously the name inside start script doesn't match used socket.

It would be nice if someone could help me with this problems or pointing me into right direction. It would be nice to use the combination of Zend Server and Zend Studio for further developing but I can't roll out Zend Server to my developers if this problems persist.

Thanks in advance

Marc

User avatar
zvika
Zend Global Support
Posts: 997
Joined: Sun Dec 14, 2008 9:48 am
Contact:

Re: ZS 9 on Mac OS 10.11.5 - Problems with random_bytes, SOA

Post by zvika » Thu Jul 14, 2016 10:26 am

Hi Marc
I also get this with ZS 9 with

Code: Select all

/usr/local/zend/bin/php -r "echo random_bytes(15);"

Code: Select all

crw-rw-rw-  1 root  wheel   11,   1 May 25 10:01 /dev/urandom
PHP Fatal error:  Uncaught Exception: Cannot open source device in Command line code:1
Stack trace:
#0 Command line code(1): random_bytes(15)
#1 {main}
  thrown in Command line code on line 1

Fatal error: Uncaught Exception: Cannot open source device in Command line code:1
Stack trace:
#0 Command line code(1): random_bytes(15)
#1 {main}
  thrown in Command line code on line 1
We will check into this.

About the Annoying problem, I'm assuming the SOAP response has some "foreign" text which is wrongly parsed.
Can you dump the responses before and after change+restart PHP, and DIFF?

About FastCGI socket chmod - I get the same, doesn't look alerting - we'll check into this.

Code: Select all

sudo /usr/local/zend/bin/zendctl.sh restart-lighttpd
Stopping Zend Server GUI [Lighttpd] [OK]
chmod: /usr/local/zend/gui/lighttpd/tmp/php-fastcgi.socket: No such file or directory
Starting Zend Server GUI [Lighttpd] [OK]
Zvika Dror
Zend Support Team

marc501
Posts: 5
Joined: Tue Jul 12, 2016 7:47 pm

Re: ZS 9 on Mac OS 10.11.5 - Problems with random_bytes, SOA

Post by marc501 » Mon Jul 18, 2016 7:46 pm

Hi Zvika,

great to hear that you're investigating this problems and that's not a misconfiguration on my side. :-)

After setting soap.wsdl_cache_enabled to "off" and restarting the complete machine the problems with the SOAP calls are gone. So must be a cache/tmp problem and on a development machine no need for caching wsdl. So this problem is solved.

Let's see what your developers can find out about the other problems. Would be nice to give my developers ZS.

Greetings

Marc

marc501
Posts: 5
Joined: Tue Jul 12, 2016 7:47 pm

Re: ZS 9 on Mac OS 10.11.5 - Problems with random_bytes, SOA

Post by marc501 » Tue Aug 02, 2016 8:57 pm

Hi Zvika,

sorry for "pushing", but the test license expires in a few days and I had no chance of really testing ZS in our development environment because of the problem with random_bytes.

Is there any hotfix or workaround I can apply so it is possible for me to test and to decide if buying and deploying ZS to my developers makes sense?


Greetings

Marc

grae6414
Posts: 1
Joined: Mon Jul 25, 2016 11:43 am

Re: ZS 9 on Mac OS 10.11.5 - Problems with random_bytes, SOA

Post by grae6414 » Wed Aug 03, 2016 1:09 am

Hi Marc,

that issue bit me as well, nearly gave up but my solution is to run Parallels on the MAC and code in the Windows environment!

Not ideal but I don't have another computer that I can develop on - I used Coherence as well and it is very 'MAC' like. You really need 16gb of ram to get it working at a reasonable speed.

Graeme

User avatar
zend_eyalt
Posts: 279
Joined: Thu Jan 22, 2009 3:16 pm

Re: ZS 9 on Mac OS 10.11.5 - Problems with random_bytes, SOA

Post by zend_eyalt » Thu Aug 04, 2016 8:17 am

Hi Marc,

We're currently investigating whether the random_bytes() bug comes from a PHP bug which has recently been fixed in PHP 7.0.9.
We should hopefully have the answers next week.

User avatar
zend_eyalt
Posts: 279
Joined: Thu Jan 22, 2009 3:16 pm

Re: ZS 9 on Mac OS 10.11.5 - Problems with random_bytes, SOA

Post by zend_eyalt » Thu Aug 04, 2016 11:45 am

BTW Marc, if you require your trial license to be extended, please don't hesitate to contact https://support.zend.com and request for the trial to be extended.

marc501
Posts: 5
Joined: Tue Jul 12, 2016 7:47 pm

Re: ZS 9 on Mac OS 10.11.5 - Problems with random_bytes, SOA

Post by marc501 » Thu Aug 04, 2016 5:20 pm

Hi,

sounds good. Hopefully the problem is fixed with this new PHP version.

If so I'll contact you to get a new run on testing ZS.

Greetings

Marc

User avatar
zend_eyalt
Posts: 279
Joined: Thu Jan 22, 2009 3:16 pm

Re: ZS 9 on Mac OS 10.11.5 - Problems with random_bytes, SOA

Post by zend_eyalt » Thu Aug 11, 2016 12:44 pm

Just to update that problem persists even after upgrading to 7.0.9, but we are still looking into this issue (has to do with tweaking the PHP compilation on MAC), so stay tuned..

User avatar
zend_eyalt
Posts: 279
Joined: Thu Jan 22, 2009 3:16 pm

Re: ZS 9 on Mac OS 10.11.5 - Problems with random_bytes, SOA

Post by zend_eyalt » Sun Aug 21, 2016 7:13 am

Happy to update that we have indeed fixed this bug in our nightly release, and the fix will be part of our forthcoming maintenance release.

If for the meantime, you would play with the nightly release installer, I suggest you contact the support at https://support.zend.com and request a copy.

Post Reply