Hi Yao,

On Fri, Apr 28, 2017 at 9:10 AM Yao Li <[email protected]> wrote:

> Hi Takashi,
>
> I did get New Relic installed successfully, thanks!
>

Great :)


>
> The current issue is 404 for API request from mobile app or Postman
> software.
>
> I have the default service (f-s.appspot.com) in standard environment and
> its API service works well, I copied code to monitor service (
> monitor-dot-f-s.appspot.com) which is deployed to flex env and it doesn't
> work now.
>
> I wonder there are 2 reasons:
> 1. security certificate
> 2. memcache for session handler (used when initialize basic API
> controller, it can pass the initialization but session doesn't work,
> actually REST api doesn't need session)
>
> API in default service works and reason 1 should not be the problem, how
> do you think about the 2nd reason or some other reasons?
>

Sorry, but I can not tell without knowing your code.

Re: session, I wrote the datastore session handler:
https://github.com/GoogleCloudPlatform/google-cloud-php/blob/master/src/Datastore/DatastoreSessionHandler.php

It will add some more latency, but only you have to do is to enable the
datastore API. Please consider using this if it's ok to add some latency.


>
> BTW, I still have not received the alpha version for memcache from the PM
> as you mentioned, maybe I have to upgrade to PHP 7+ and use memcached.
>
>
I talked with the PM again today, I can not promise anything though.

Thanks,


>
> On Wednesday, April 26, 2017 at 8:33:55 PM UTC-7, Takashi Matsuo (Google)
> wrote:
>
>>
>> I often do:
>> ```
>> apt-get update && apt-get install -y vim less
>> ```
>> If you're using runtime:custom, maybe you can install them during
>> development phase
>>
>> On Wed, Apr 26, 2017 at 8:28 PM Yao Li <[email protected]> wrote:
>>
> I want to check the log file in the docker container, but none of vi, vim,
>>> nano works. Do I need to install text editor in the docker image or some
>>> other way to view the content?
>>>
>>> Or use scp to copy to my mac?
>>>
>>>
>>> On Wednesday, April 26, 2017 at 2:44:11 PM UTC-7, Takashi Matsuo
>>> (Google) wrote:
>>>
>>>>
>>>> Hi Yao,
>>>>
>>>> According to their docs, I think you need to use this method:
>>>> PHP agent installation: Non-standard PHP (advanced)
>>>> <https://docs.newrelic.com/docs/agents/php-agent/advanced-installation/php-agent-installation-non-standard-php-advanced>
>>>>
>>>> Unfortunately we're not using the debian's official apt package.
>>>>
>>>> On Wed, Apr 26, 2017 at 2:31 PM Yao Li <[email protected]> wrote:
>>>>
>>> Hi Takashi,
>>>>>
>>>>> I'm installing New Relic PHP agent based on php-nginx docker image, it
>>>>> does finish all commands in Dockerfile but not show New Relic in phpinfo()
>>>>> page (phpinfo() will show New Relic module if installed successfully), how
>>>>> to ensure run the installation command with root user in bash shell or
>>>>> Dockerfile?
>>>>>
>>>>> I tried both of following cases, but neither of them work.
>>>>>
>>>>> Code 0:
>>>>> Dockerfile
>>>>> ```
>>>>> RUN su www-data -c "newrelic-install install"
>>>>> ```
>>>>>
>>>>> Code 1:
>>>>> install_new_relic.sh (it complains error if add sudo or su before
>>>>> newrelic-install)
>>>>> ```
>>>>> newrelic-install install
>>>>> ```
>>>>>
>>>>> Logs:
>>>>> + apt-get install -yq newrelic-php5
>>>>> Reading package lists...
>>>>> Building dependency tree...
>>>>> Reading state information...
>>>>> The following extra packages will be installed:
>>>>>   newrelic-daemon newrelic-php5-common
>>>>> The following NEW packages will be installed:
>>>>>   newrelic-daemon newrelic-php5 newrelic-php5-common
>>>>> 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
>>>>> Need to get 8634 kB of archives.
>>>>> After this operation, 25.9 MB of additional disk space will be used.
>>>>> Get:1 http://apt.newrelic.com/debian/ newrelic/non-free
>>>>> newrelic-php5-common all 7.2.0.191 [26.2 kB]
>>>>> Get:2 http://apt.newrelic.com/debian/ newrelic/non-free
>>>>> newrelic-daemon amd64 7.2.0.191 [2810 kB]
>>>>> Get:3 http://apt.newrelic.com/debian/ newrelic/non-free newrelic-php5
>>>>> amd64 7.2.0.191 [5798 kB]
>>>>> Preconfiguring packages ...
>>>>> Fetched 8634 kB in 1s (5053 kB/s)
>>>>> Selecting previously unselected package newrelic-php5-common.
>>>>> (Reading database ... 14536 files and directories currently installed.)
>>>>> Preparing to unpack .../newrelic-php5-common_7.2.0.191_all.deb ...
>>>>> Unpacking newrelic-php5-common (7.2.0.191) ...
>>>>> Setting up newrelic-php5-common (7.2.0.191) ...
>>>>> Selecting previously unselected package newrelic-daemon.
>>>>> (Reading database ... 14549 files and directories currently installed.)
>>>>> Preparing to unpack .../newrelic-daemon_7.2.0.191_amd64.deb ...
>>>>> Unpacking newrelic-daemon (7.2.0.191) ...
>>>>> Processing triggers for systemd (215-17+deb8u6) ...
>>>>> Setting up newrelic-daemon (7.2.0.191) ...
>>>>> Processing triggers for systemd (215-17+deb8u6) ...
>>>>> Selecting previously unselected package newrelic-php5.
>>>>> (Reading database ... 14557 files and directories currently installed.)
>>>>> Preparing to unpack .../newrelic-php5_7.2.0.191_amd64.deb ...
>>>>> Unpacking newrelic-php5 (7.2.0.191) ...
>>>>> Setting up newrelic-php5 (7.2.0.191) ...
>>>>> Please run newrelic-install as root to complete installation.
>>>>> + newrelic-install install
>>>>>  ---> 1fef98f9ee82
>>>>> Removing intermediate container 42cf882e3357
>>>>>
>>>>>
>>>>> On Wednesday, April 26, 2017 at 11:37:11 AM UTC-7, Yao Li wrote:
>>>>>
>>>>>> Ok, we can talk with Hangout.
>>>>>>
>>>>>> On Wednesday, April 26, 2017 at 11:26:36 AM UTC-7, Takashi Matsuo
>>>>>> (Google) wrote:
>>>>>>
>>>>>
>>>>>>> Hi Yao,
>>>>>>>
>>>>>>> According to "Availability: dynamic", it looks to me that you look
>>>>>>> at the App Engine Standard instance. Make sure you choose the Flex 
>>>>>>> version.
>>>>>>>
>>>>>>> The VM runs a container named `gaeapp` for your application. Did you
>>>>>>> do `docker ps`  in the application container?
>>>>>>>
>>>>>>> I'm happy to explain this process on a video call or something if it
>>>>>>> does make sense to you.
>>>>>>>
>>>>>>> -- Takashi
>>>>>>>
>>>>>>> On Wed, Apr 26, 2017 at 8:53 AM Yao Li <[email protected]> wrote:
>>>>>>>
>>>>>> I can see ssh button in Firefox but Chrome, it should be a Chrome
>>>>>>>> issue.
>>>>>>>>
>>>>>>>> I went to docker container gaeapp, but I didn't see any docker
>>>>>>>> container is running (empty after docker ps), no images neither (empty
>>>>>>>> after docker images). But I tried kill -HUP 1 and it does affect the
>>>>>>>> application (shut down).
>>>>>>>>
>>>>>>>>
>>>>>>>> ```
>>>>>>>> sudo docker exec -t -i gaeapp /bin/bash
>>>>>>>> ```
>>>>>>>>
>>>>>>>> Do I need replace 'gaeapp' to my project id or service name?
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tuesday, April 25, 2017 at 4:41:01 PM UTC-7, Yao Li wrote:
>>>>>>>>
>>>>>>>>> I cannot find ssh button (as top right corner in screenshot), is
>>>>>>>>> it because of permission or some other reason?
>>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> <https://lh3.googleusercontent.com/-hXjjn3iAxi8/WP_ee3pYtLI/AAAAAAAAAaE/vdf1qcgtTsMTUD7QrLY3jtl6u4zEM4RtACLcB/s1600/Screen%2BShot%2B2017-04-25%2Bat%2B4.38.59%2BPM.png>
>>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Tuesday, April 25, 2017 at 4:10:59 PM UTC-7, Takashi Matsuo
>>>>>>>>> (Google) wrote:
>>>>>>>>>
>>>>>>>>
>>>>>>>>>> Hi Yao,
>>>>>>>>>>
>>>>>>>>>> You can ssh into the VM; Go to the Cloud Console, and App Engine
>>>>>>>>>> -> instances -> ssh.
>>>>>>>>>>
>>>>>>>>>> Once ssh into it, you can go into the docker container:
>>>>>>>>>>
>>>>>>>>>> ```
>>>>>>>>>> sudo docker exec -t -i gaeapp /bin/bash
>>>>>>>>>> ```
>>>>>>>>>>
>>>>>>>>>> Then you can restart everything in the Docker container by:
>>>>>>>>>> ```
>>>>>>>>>> kill -HUP 1
>>>>>>>>>> ```
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Tue, Apr 25, 2017 at 1:11 PM Yao Li <[email protected]> wrote:
>>>>>>>>>>
>>>>>>>>> Hi Takashi,
>>>>>>>>>>>
>>>>>>>>>>> I installed New Relic Agent in custom php-nginx docker image but
>>>>>>>>>>> it doesn't show any data and I'm investigating it.
>>>>>>>>>>>
>>>>>>>>>>> Is there a way to do restart (nginx, php-fpm, httpd, etc.) and
>>>>>>>>>>> ls (look up new relic extension in specific directory) in GAE Flex 
>>>>>>>>>>> env?
>>>>>>>>>>>
>>>>>>>>>>> Right now I make a new image and re-deploy to restart but seems
>>>>>>>>>>> not working.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Tuesday, April 25, 2017 at 9:47:14 AM UTC-7, Takashi Matsuo
>>>>>>>>>>> (Google) wrote:
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Hi Yao,
>>>>>>>>>>>>
>>>>>>>>>>>> I asked a PM who is responsible for it (it turned out it's not
>>>>>>>>>>>> Justin). I will reply you off-thread.
>>>>>>>>>>>>
>>>>>>>>>>> On Tue, Apr 25, 2017 at 9:25 AM Yao Li <[email protected]> wrote:
>>>>>>>>>>>>
>>>>>>>>>>> Hi Takashi,
>>>>>>>>>>>>>
>>>>>>>>>>>>> Could you ask Justin to send me a test (alpha) version
>>>>>>>>>>>>> including memcache?
>>>>>>>>>>>>>
>>>>>>>>>>>>> As the doc, Redis Lab Memcache supports memcached, not
>>>>>>>>>>>>> memcache.
>>>>>>>>>>>>>
>>>>>>>>>>>>> https://cloud.google.com/appengine/docs/flexible/php/using-redislabs-memcache
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Tuesday, April 25, 2017 at 8:42:17 AM UTC-7, Takashi Matsuo
>>>>>>>>>>>>> (Google) wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi Yao,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Yes, you are right.
>>>>>>>>>>>>>>
>>>>>>>>>>>>> On Tue, Apr 25, 2017, 8:39 AM Yao Li <[email protected]> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>> Hi Takashi,
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> This instruction is only about Logging, doesn't include
>>>>>>>>>>>>>>> memcache, right?
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Monday, April 24, 2017 at 9:31:54 PM UTC-7, Takashi
>>>>>>>>>>>>>>> Matsuo (Google) wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Hi Yao,
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Alright, I've just sent you the instructions.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Thanks!
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Mon, Apr 24, 2017 at 9:17 PM Yao Li <[email protected]>
>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Yes, I'm interested in the alpha version and new log service.
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> I tried Redis Lab Memcache, it doesn't support memcache,
>>>>>>>>>>>>>>>>> only memcached?
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> On Monday, April 24, 2017 at 8:45:36 PM UTC-7, Takashi
>>>>>>>>>>>>>>>>> Matsuo (Google) wrote:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Adding our PM
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> On Mon, Apr 24, 2017 at 8:29 PM Yao Li <[email protected]>
>>>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> I'm interested in App Engine Flex PHP alpha version and
>>>>>>>>>>>>>>>>>>> did fill the register form but have not received any 
>>>>>>>>>>>>>>>>>>> response.
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> I think you are referring to the alpha program of the
>>>>>>>>>>>>>>>>>> memcache service. If that's the case, Justin knows more 
>>>>>>>>>>>>>>>>>> about the program.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> What I was saying is for our new logging library :)
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> The new logging library will provide 1) PSR3 interface,
>>>>>>>>>>>>>>>>>> 2) automatic capturing Fatal errors and unhanded Exceptions 
>>>>>>>>>>>>>>>>>> to Stackdriver
>>>>>>>>>>>>>>>>>> Error Rerporting, 3) high throughput and low latency.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Let me know if you're interested in.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> -- Takashi
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> On Monday, April 24, 2017 at 6:32:12 PM UTC-7, Takashi
>>>>>>>>>>>>>>>>>>> Matsuo (Google) wrote:
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> Hi Yao,
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> > I copied data from a 1st generation cloud sql
>>>>>>>>>>>>>>>>>>>> instance to a 2nd one, data is exactly same but the size 
>>>>>>>>>>>>>>>>>>>> is doubled, is it
>>>>>>>>>>>>>>>>>>>> because of the 2nd generation one specific attribute?
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> Sorry I'm not an expert on that topic. Maybe you can
>>>>>>>>>>>>>>>>>>>> try google-cloud-sql-discuss
>>>>>>>>>>>>>>>>>>>> <https://groups.google.com/forum/#!forum/google-cloud-sql-discuss>
>>>>>>>>>>>>>>>>>>>> list?
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> Glad to hear you could connect to Cloud SQL and see the
>>>>>>>>>>>>>>>>>>>> logs!
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> BTW, we're going to start alpha tester program for the
>>>>>>>>>>>>>>>>>>>> new logging library on App Engine Flex PHP.
>>>>>>>>>>>>>>>>>>>> Are you interested in testing it out?
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> Thanks,
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> On Mon, Apr 24, 2017 at 3:28 PM Yao Li <[email protected]>
>>>>>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> 1. *CloudSQL*
>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>> I did connect successfully by setting default socket
>>>>>>>>>>>>>>>>>>>>> in php.ini. Thanks.
>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>> I copied data from a 1st generation cloud sql instance
>>>>>>>>>>>>>>>>>>>>> to a 2nd one, data is exactly same but the size is 
>>>>>>>>>>>>>>>>>>>>> doubled, is it because
>>>>>>>>>>>>>>>>>>>>> of the 2nd generation one specific attribute?
>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>> 2. *Log*
>>>>>>>>>>>>>>>>>>>>> I did choose the logname 'stderr' in the logging
>>>>>>>>>>>>>>>>>>>>> console and it only prints out the content inside 
>>>>>>>>>>>>>>>>>>>>> fwrite(), like 'Log to
>>>>>>>>>>>>>>>>>>>>> stderr' in your example. Anyway, it can log now.
>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>> On Monday, April 24, 2017 at 10:54:47 AM UTC-7,
>>>>>>>>>>>>>>>>>>>>> Takashi Matsuo (Google) wrote:
>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> Hi Yao,
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> *1. CloudSQL*
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> Yes, we recommend that you use the unix socket.
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> If you're using mysql_connect, you may be able to
>>>>>>>>>>>>>>>>>>>>>> use 'localhost:/cloudsql/CONNECTION_NAME' as the host 
>>>>>>>>>>>>>>>>>>>>>> name.
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> ```php.ini
>>>>>>>>>>>>>>>>>>>>>> extension=mysql.so
>>>>>>>>>>>>>>>>>>>>>> sql.safe_mode=false
>>>>>>>>>>>>>>>>>>>>>> ```
>>>>>>>>>>>>>>>>>>>>>> Then:
>>>>>>>>>>>>>>>>>>>>>> $db = mysql_connect('localhost:/cloudsql/CONNECTION_
>>>>>>>>>>>>>>>>>>>>>> NAME', 'USER', 'PASSWORD');
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> If you're using mysqli_connect, you can specify the
>>>>>>>>>>>>>>>>>>>>>> default socket in php.ini.
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> ```php.ini
>>>>>>>>>>>>>>>>>>>>>> mysqli.default_socket= '/cloudsql/CONNECTION_NAME'
>>>>>>>>>>>>>>>>>>>>>> ```
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> $db = mysqli_connect('localhost', 'USER', 'PASSWORD',
>>>>>>>>>>>>>>>>>>>>>> 'DB');
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> *2. Log*
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> I can not reproduce your issue. Here is a simple app
>>>>>>>>>>>>>>>>>>>>>> trying to repro, but I see the logs in the logs viewer.
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> ```app.yaml
>>>>>>>>>>>>>>>>>>>>>> runtime: php
>>>>>>>>>>>>>>>>>>>>>> env: flex
>>>>>>>>>>>>>>>>>>>>>> ```
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> ```php-fpm.conf
>>>>>>>>>>>>>>>>>>>>>> [global]
>>>>>>>>>>>>>>>>>>>>>> error_log = /dev/stderr
>>>>>>>>>>>>>>>>>>>>>> ```
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> ```index.php
>>>>>>>>>>>>>>>>>>>>>> <?php
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> $fp = fopen('php://stderr', 'w');
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> fwrite($fp, 'Log to stderr' . PHP_EOL);
>>>>>>>>>>>>>>>>>>>>>> fclose($fp);
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> error_log('Log with error_log()');
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> echo 'Sent a log to stderr, and error_log';
>>>>>>>>>>>>>>>>>>>>>> ```
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> You may have to choose the logname 'stderr' in the
>>>>>>>>>>>>>>>>>>>>>> logging console to see those logs.
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> *3. Extension*
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> Currently you have to use the custom runtime, and
>>>>>>>>>>>>>>>>>>>>>> yeah the Dockerfile for deb-package-builder will guide 
>>>>>>>>>>>>>>>>>>>>>> you which apt
>>>>>>>>>>>>>>>>>>>>>> packages are need for compiling extensions.
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> Thanks!
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> -- Takashi
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> On Mon, Apr 24, 2017 at 9:39 AM Yao Li <
>>>>>>>>>>>>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>> I want to install New Relic agent in the custom image
>>>>>>>>>>>>>>>>>>>>>>> (php-nginx) to monitor app level performance, as the 
>>>>>>>>>>>>>>>>>>>>>>> code in php-docker
>>>>>>>>>>>>>>>>>>>>>>> (deb-package-builder) repo, GAE flex env is based on 
>>>>>>>>>>>>>>>>>>>>>>> Debian, is there any
>>>>>>>>>>>>>>>>>>>>>>> libs or scripts to install software (new relic) in this 
>>>>>>>>>>>>>>>>>>>>>>> environment?
>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>> https://github.com/GoogleCloudPlatform/php-docker
>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>> https://docs.newrelic.com/docs/agents/php-agent/getting-started/introduction-new-relic-php
>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>> On Monday, April 24, 2017 at 8:31:40 AM UTC-7, Yao
>>>>>>>>>>>>>>>>>>>>>>> Li wrote:
>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>> 1. Cloud SQL
>>>>>>>>>>>>>>>>>>>>>>>> It doesn't expose mysql unix_socket in the company
>>>>>>>>>>>>>>>>>>>>>>>> framework but host, I did try to config host as the 
>>>>>>>>>>>>>>>>>>>>>>>> cloud sql instance ip
>>>>>>>>>>>>>>>>>>>>>>>> or 'localhost' for host parameter, but nether of them 
>>>>>>>>>>>>>>>>>>>>>>>> work. Can I use host
>>>>>>>>>>>>>>>>>>>>>>>> (cloud sql instance ip) for mysql configuration in 
>>>>>>>>>>>>>>>>>>>>>>>> this case or only
>>>>>>>>>>>>>>>>>>>>>>>> unix_socket works?
>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>> 2. Logging
>>>>>>>>>>>>>>>>>>>>>>>> It doesn't print anything in Logs View even after
>>>>>>>>>>>>>>>>>>>>>>>> add [global] in php-fpm.conf
>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>> On Saturday, April 22, 2017 at 7:40:02 AM UTC-7,
>>>>>>>>>>>>>>>>>>>>>>>> Takashi Matsuo (Google) wrote:
>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>> Hi Yao,
>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>> On Fri, Apr 21, 2017 at 11:29 PM Yao Li <
>>>>>>>>>>>>>>>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>> 1. I use Second Generation Instance for Cloud SQL in 
>>>>>>>>>>>>>>>>>>>>>>>>>> flex environment, did enable 'sqladmin' on my 
>>>>>>>>>>>>>>>>>>>>>>>>>> project.
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>> The cloud sql instance log shows:
>>>>>>>>>>>>>>>>>>>>>>>>>> 10:12:52.4252017-04-21T17:12:52.425362Z 7115 [Note] 
>>>>>>>>>>>>>>>>>>>>>>>>>> Aborted connection 7115 to db: 'f_s' user: 'f-s' 
>>>>>>>>>>>>>>>>>>>>>>>>>> host: '66.*.*.210' (Got timeout reading 
>>>>>>>>>>>>>>>>>>>>>>>>>> communication packets)
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>> Looks like you're using the IP address? On App
>>>>>>>>>>>>>>>>>>>>>>>>> Engine Flex, you can use the local socket.
>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>> ```app.yaml
>>>>>>>>>>>>>>>>>>>>>>>>> env: flex
>>>>>>>>>>>>>>>>>>>>>>>>> runtime: php
>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>> beta_settings:
>>>>>>>>>>>>>>>>>>>>>>>>>   cloud_sql_instances: "CONNECTION_NAME"
>>>>>>>>>>>>>>>>>>>>>>>>> ```
>>>>>>>>>>>>>>>>>>>>>>>>> Replace the CONNECTION_NAME with your Cloud SQL
>>>>>>>>>>>>>>>>>>>>>>>>> connection name. This beta_settings will create a 
>>>>>>>>>>>>>>>>>>>>>>>>> local socket for you on
>>>>>>>>>>>>>>>>>>>>>>>>> the VM.
>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>> Then in your code, you use the connection name
>>>>>>>>>>>>>>>>>>>>>>>>> again:
>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>> ```
>>>>>>>>>>>>>>>>>>>>>>>>> $pdo = new PDO(
>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>> 'mysql:dbname=DB_NAME;unix_socket=/cloudsql/CONNECTION_NAME',
>>>>>>>>>>>>>>>>>>>>>>>>>     'DB_USERNAME',
>>>>>>>>>>>>>>>>>>>>>>>>>     'DB_PASSWORD'
>>>>>>>>>>>>>>>>>>>>>>>>> );
>>>>>>>>>>>>>>>>>>>>>>>>> ```
>>>>>>>>>>>>>>>>>>>>>>>>> Replace the DB_NAME, CONNECTION_NAME, DB_USERNAME,
>>>>>>>>>>>>>>>>>>>>>>>>> and DB_PASSWORD respectively, then you should be good 
>>>>>>>>>>>>>>>>>>>>>>>>> to go.
>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>> 2. Logging
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>> It complains error after put a file named 
>>>>>>>>>>>>>>>>>>>>>>>>>> php-fpm.conf in the project root.
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>> [22-Apr-2017 06:07:42] ERROR: 
>>>>>>>>>>>>>>>>>>>>>>>>>> [/opt/php/etc/php-fpm-user.conf:1] unknown entry 
>>>>>>>>>>>>>>>>>>>>>>>>>> 'error_log'
>>>>>>>>>>>>>>>>>>>>>>>>>> [22-Apr-2017 06:07:42] ERROR: Unable to include 
>>>>>>>>>>>>>>>>>>>>>>>>>> /opt/php/etc/php-fpm-user.conf from 
>>>>>>>>>>>>>>>>>>>>>>>>>> /opt/php/etc/php-fpm.conf at line 1
>>>>>>>>>>>>>>>>>>>>>>>>>> [22-Apr-2017 06:07:42] ERROR: failed to load 
>>>>>>>>>>>>>>>>>>>>>>>>>> configuration file '/opt/php/etc/php-fpm.conf'
>>>>>>>>>>>>>>>>>>>>>>>>>> [22-Apr-2017 06:07:42] ERROR: FPM initialization 
>>>>>>>>>>>>>>>>>>>>>>>>>> failed
>>>>>>>>>>>>>>>>>>>>>>>>>> 2017-04-22 06:07:42,142 INFO spawned: 'php-fpm' with 
>>>>>>>>>>>>>>>>>>>>>>>>>> pid 41
>>>>>>>>>>>>>>>>>>>>>>>>>> 2017-04-22 06:07:42,170 INFO exited: php-fpm (exit 
>>>>>>>>>>>>>>>>>>>>>>>>>> status 78; not expected)
>>>>>>>>>>>>>>>>>>>>>>>>>> 2017-04-22 06:07:43,171 INFO gave up: php-fpm 
>>>>>>>>>>>>>>>>>>>>>>>>>> entered FATAL state, too many start retries too 
>>>>>>>>>>>>>>>>>>>>>>>>>> quickly
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>> Oops! My bad. You need the `global` section too.
>>>>>>>>>>>>>>>>>>>>>>>>> ```
>>>>>>>>>>>>>>>>>>>>>>>>> [global]
>>>>>>>>>>>>>>>>>>>>>>>>> error_log = /dev/stderr
>>>>>>>>>>>>>>>>>>>>>>>>> ```
>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>> Thanks!
>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>> On Friday, April 21, 2017 at 8:00:38 PM UTC-7,
>>>>>>>>>>>>>>>>>>>>>>>>>> Takashi Matsuo (Google) wrote:
>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>> Hi Yao,
>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>> Sorry! I was wrong.  The constants STDERR is
>>>>>>>>>>>>>>>>>>>>>>>>>>> only available for CLI SAPI.
>>>>>>>>>>>>>>>>>>>>>>>>>>> Also, the current php-fpm.conf just throws the
>>>>>>>>>>>>>>>>>>>>>>>>>>> logs on STDERR away (my fault).
>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>> We will fix this early next week, but for a time
>>>>>>>>>>>>>>>>>>>>>>>>>>> being, you can put a file named php-fpm.conf in the 
>>>>>>>>>>>>>>>>>>>>>>>>>>> project root with the
>>>>>>>>>>>>>>>>>>>>>>>>>>> following:
>>>>>>>>>>>>>>>>>>>>>>>>>>> ```
>>>>>>>>>>>>>>>>>>>>>>>>>>> error_log = /dev/stderr
>>>>>>>>>>>>>>>>>>>>>>>>>>> ```
>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>> Then the following code will work:
>>>>>>>>>>>>>>>>>>>>>>>>>>> ```
>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>> $stderr = fopen('php://stderr', &#3
>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/google-appengine.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-appengine/faef8628-7d42-4953-82bf-87bcc2a9d370%40googlegroups.com
> <https://groups.google.com/d/msgid/google-appengine/faef8628-7d42-4953-82bf-87bcc2a9d370%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
-- Takashi

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CADWEYXinUuH2M63wZTK3MCZU9qmrx8gtQDGPt-FgoUorkSVncw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to