Re: PHP extension 'gettext' doesn't work?


Daniel Mikusa
 

This looks OK. I'm not seeing any build pack errors. Could you include
your sample PHP code?

See comments inline below.

On Wed, Sep 30, 2015 at 1:44 AM, Hiroaki Ukaji <dt3snow.w(a)gmail.com> wrote:

Hi.
Thanks for your reply.

Yes, I also think the extension is loading in application container,
however, the function (which was able to be activated properly in a local
machine) perhaps doesn't work.
Anyway, I'm sorry about my less information. I'm trying to write details
again.

- what version of PHP are you using?
>>> we're using PHP-5.5.23
(php-buildpack version is v3.2.1, which is default in cf-release
v211. we're operating them on bosh-lite (tree:552dc68696), and using cf-cli
v6.12.0.).
Could you try with the latest build pack? That would rule out any issues
that have been already addressed.



- how are you enabling the extension: options.json or composer.json?
>>> by "PHP_EXTENSION" in .bp-config/options.json.
OK


- what's the full output of `cf push`?
- what's the output of `cf logs` when you try to access a page that uses
`gettext`?
>>> please observe the following.

********** `cf push` **********
$ git clone https://github.com/nota-ja/php-gettext-example
$ cd php-gettext-example/
php-gettext-example$ cf push php-gettext-example
Creating app php-gettext-example in org ukaji / space default as ukaji...
OK

Creating route php-gettext-example.10.244.0.34.xip.io...
OK

Binding php-gettext-example.10.244.0.34.xip.io to php-gettext-example...
OK

Uploading php-gettext-example...
Uploading app files from: /home/ukaji/workspace/php-gettext-example
Uploading 2.8K, 9 files
Done uploading
OK

Starting app php-gettext-example in org ukaji / space default as ukaji...
-----> Downloaded app package (4.0K)
-------> Buildpack version 3.2.1
<snip/>


Installing PHP
PHP 5.5.23
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 5000k 100 5000k 0 0 449M 0 --:--:-- --:--:-- --:--:--
449M
Downloaded
[
https://pivotal-buildpacks.s3.amazonaws.com/php/binaries/trusty/php/5.5.23/php-5.5.23.tar.gz
]
to [/tmp]
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 8640k 100 8640k 0 0 341M 0 --:--:-- --:--:-- --:--:--
341M
Downloaded
[
https://pivotal-buildpacks.s3.amazonaws.com/php/binaries/trusty/php/5.5.23/php-fpm-5.5.23.tar.gz
]
to [/tmp]
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 18857 100 18857 0 0 105M 0 --:--:-- --:--:-- --:--:--
105M
Downloaded
[
https://pivotal-buildpacks.s3.amazonaws.com/php/binaries/trusty/php/5.5.23/php-gettext-5.5.23.tar.gz
]
OK, so the extension is being installed. That's good.


to [/tmp]
% Total % Received % Xferd Average Speed Time Time Time
Current
Dload Upload Total Spent Left
Speed
100 1046k 100 1046k 0 0 297M 0 --:--:-- --:--:-- --:--:--
427M
Downloaded
[
https://pivotal-buildpacks.s3.amazonaws.com/php/binaries/trusty/php/5.5.23/php-mbstring-5.5.23.tar.gz
]
to [/tmp]
Finished: [2015-09-30 02:14:06.118672]
-----> Uploading droplet (17M)

1 of 1 instances running

App started
The app is starting OK, that's good.


OK

App php-gettext-example was started using this command
`$HOME/.bp/bin/start`

Showing health and status for app php-gettext-example in org ukaji / space
default as ukaji...
OK

requested state: started
instances: 1/1
usage: 256M x 1 instances
urls: php-gettext-example.10.244.0.34.xip.io
last uploaded: Wed Sep 30 02:13:59 UTC 2015
stack: cflinuxfs2
buildpack: PHP

state since cpu memory disk
details
#0 running 2015-09-30 11:14:12 AM 0.0% 22.6M of 256M 0 of 1G
php-gettext-example$ curl php-gettext-example.10.244.0.34.xip.io

/home/vcap/app/htdocs/locale: hello-world
So, I take it "hello-world" should be replaced with a localized version?


********************

********** `cf logs` when I access a page **********
I don't see any errors in the logs, so that's good. If the extension
failed to load, it should show up here.

Dan



curl
2015-09-30T11:15:28.79+0900 [RTR/0] OUT
php-gettext-example.10.244.0.34.xip.io - [30/09/2015:02:15:28 +0000] "GET
/
HTTP/1.1" 200 0 46 "-" "curl/7.35.0" 10.0.2.15:56004
x_forwarded_for:"192.168.50.1, 10.0.2.15"
vcap_request_id:62553a95-d90f-462c-5059-5f66ea826e70
response_time:0.007372778 app_id:d3ec3374-9460-4206-b2e0-159ce37686a8
2015-09-30T11:15:28.79+0900 [App/0] OUT 02:15:28 httpd |
192.168.50.1
- - [30/Sep/2015:02:15:28 +0000] "GET / HTTP/1.1" 200 46
vcap_request_id=62553a95-d90f-462c-5059-5f66ea826e70 peer_addr=10.0.2.15

accessing from a browser(google chrome)
2015-09-30T11:16:40.76+0900 [RTR/0] OUT
php-gettext-example.10.244.0.34.xip.io - [30/09/2015:02:16:40 +0000] "GET
/
HTTP/1.1" 200 0 46 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.42 Safari/537.36"
10.0.2.15:56760 x_forwarded_for:"192.168.50.1, 10.0.2.15"
vcap_request_id:96c67b24-dfb1-4dfe-7b23-e850ccc75e4b
response_time:0.008837383 app_id:d3ec3374-9460-4206-b2e0-159ce37686a8
2015-09-30T11:16:40.78+0900 [App/0] OUT 02:16:40 httpd |
192.168.50.1
- - [30/Sep/2015:02:16:40 +0000] "GET / HTTP/1.1" 200 46
vcap_request_id=96c67b24-dfb1-4dfe-7b23-e850ccc75e4b peer_addr=10.0.2.15
2015-09-30T11:16:40.87+0900 [RTR/0] OUT
php-gettext-example.10.244.0.34.xip.io - [30/09/2015:02:16:40 +0000] "GET
/favicon.ico HTTP/1.1" 404 0 209
"http://php-gettext-example.10.244.0.34.xip.io/" "Mozilla/5.0 (Macintosh;
Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/46.0.2490.42 Safari/537.36" 10.0.2.15:56760
x_forwarded_for:"192.168.50.1, 10.0.2.15"
vcap_request_id:34075545-f921-4597-6564-9249f7586a1b
response_time:0.004353567 app_id:d3ec3374-9460-4206-b2e0-159ce37686a8
2015-09-30T11:16:40.88+0900 [App/0] OUT 02:16:40 httpd | [Wed Sep 30
02:16:40.873592 2015] [core:info] [pid 46:tid 139946828056320] [client
192.168.50.1:41285] AH00128: File does not exist:
/home/vcap/app/htdocs/favicon.ico, referer:
http://php-gettext-example.10.244.0.34.xip.io/
2015-09-30T11:16:40.88+0900 [App/0] OUT 02:16:40 httpd |
192.168.50.1
- - [30/Sep/2015:02:16:40 +0000] "GET /favicon.ico HTTP/1.1" 404 209
vcap_request_id=34075545-f921-4597-6564-9249f7586a1b peer_addr=10.0.2.15
********************


I hope these answer your questions.

Thanks.

Hiroaki UKAJI




--
View this message in context:
http://cf-dev.70369.x6.nabble.com/cf-dev-PHP-extension-gettext-doesn-t-work-tp1984p2000.html
Sent from the CF Dev mailing list archive at Nabble.com.

Join cf-dev@lists.cloudfoundry.org to automatically receive all group messages.