Trying to build GAE PHP runtime extension - google-app-engine

I'm trying to build GAE PHP runtime extension for local development.
I've followed instructions described in https://github.com/GoogleCloudPlatform/appengine-php-extension
When running the .configure i get the following error:
configure: error: Invalid protobuf include path /home/sergio/Workspace/appengine-php-extension
The configure command:
./configure --enable-gae --with-protobuf_inc=/home/sergio/Workspace/appengine-php-extension --with-protobuf_lib=/home/sergio/Workspace/appengine-php-extension
/home/sergio/Workspace/appengine-php-extension is the absolut path to the headers and libraries created on the second step of the instructions:
Set and to the absolute path to the protobuf headers and libraries installed in the previous step, usually /usr/local/include and /usr/local/lib.
I've tryed to use /usr/local/include and /usr/local/lib. Didn't work either. Does any one know what I have missed?

For your proyect is absoluty necesary custom appengine-php-extension. You could use app-engine-php by default.
Only download google cloud sdk: https://cloud.google.com/sdk/docs/?hl=es
And after install the php extension:
gcloud components install app-engine-php

Related

Building Anjay tutorial codes

I'm getting some difficulties on building the tutorial codes of Anjay https://github.com/AVSystem/Anjay. the doc wasn't really helpful.
I tried a simple :
cd examples/tutorial/custom-object
cmake . && make
but I'm getting this message :
By not providing "Findanjay.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "anjay", but
CMake did not find one.
Could not find a package configuration file provided by "anjay" with any of
the following names:
anjayConfig.cmake
anjay-config.cmake
Add the installation prefix of "anjay" to CMAKE_PREFIX_PATH or set
"anjay_DIR" to a directory containing one of the above files. If "anjay"
provides a separate development package or SDK, be sure it has been
installed.
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.10)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
I would appreciate any suggetions.
Thank you.
I was doing the same thing. The error is because you have not installed anjay libraries on your local system or provide a way for CMake to find it.
I installed it by following steps mentioned in compilation docs
In the root of Anjay directory execute the following:
cmake . && make && sudo make install

How to compile modsecurity on Ubuntu?

After I followed the instructions in (Building Custom ModSecurity Modules)section in modsecurity dev guide in order to compile (mod_tfn_reverse.c) using the command apxs -ca mod_tfn_reverse.c, I'm still finding "fatal errors" such as unable to find the file modsecurity.h mentioned in the header of the C document.
Here is the link to the source on github modsec
Instructions I did:
I am using Ubuntu 14.4 64bits (New installation with updates).
I installed "apache dev" package, to run "APXS" command on terminal.
Downloaded "modsecurity" zip file from github.
I extracted the zip file, then I located where the mod_tfn_reverse.c is.
It's path : ModSecurity/ext/mod_tfn_reverse.c
Then I changed the directory to the targeted file CD modsecurity/ext
as I placed the folder in "home".
Finally, I executed the command apxs -ca mod_tfn_reverse.c.
These are the instructions I did, apxs works, but the compilation fails because "modsecurity.h" declared in the header was not found, I searched this file I found it in another directory (ModSecurity/apache2/modsecurity.h).
So, the difficulty is, how can I successfully compile that specific file and have the module done and ready to use in apache2 server.
I am also confused about what are the other archives, headers, and development tools required to:
to compile a custom apache module.
to compile mod_tfn_reverse.c, in my case, knowing that this is only the starting point to create custom module for modsecurity.
This is covered by the included README:
apxs -I<MODSECURITY_SOURCE_CODE> -I/usr/include/libxml2 \
-ca mod_tfn_reverse.c

Can't find shared library running freshly-built nginx

I've built nginx on my target machine (Linux) with a 3rd party module (ngx_mongo).
This module required two additional libraries to be present: pcre and yajl.
I built and installed these two separately and they installed to /usr/local/lib and headers to /usr/local/include.
I then configured nginx's build: configure --add-module=/home/greg.zoller/working/ngx_mongo
This found all the needed libs and successfully built w/o errors.
Installed nginx to default /usr/local/nginx.
When I go to run /usr/local/nginx/sbin/nginx I get this error:
./nginx: error while loading shared libraries: libyajl.so.2: cannot open shared object file: No such file or directory
Why can't it find libyajl.so.2? This file exists in /usr/local/lib and the build found it.
I ran ldconfig -v and the yajl library was not there. I tried running (as root and not) just ldconfig. No change.
What am I missing?
The dynamic loader only looks for libs present in folders declared in /etc/ld.so.conf. /usr/local/lib may not be there by default. Also when a new lib is added, you need to run ldconfig since the contents of lib folders are cached.

freeglut error LNK1104

In my project I want to use a freeglut library from the unofficial opengl sdk.
I used Premake to generate build files for vs2010. Then I built all libraries (debug). In my project I set Additional Include Directories, Additional Library Directories for the freeglut. In additional dependencies I added freeglutD.lib.
In the code I just include a freeglut header. When I want to run the program I get an error:
>LINK : fatal error LNK1104: cannot open file 'freeglut.lib'.
The freeglutD.lib is the only file in sdk/freeglut/lib. There is no freeglut.dll and freeglut.lib in sdk.
Earlier I was using freeglut 2.8.0 MSVC Package from link which is linked dynamically (contain freeglut.dll) and everything works fine.
What is wrong ?
My guess is that you forgot these lines from the documentation on using the SDK:
You will also need to add some #defines to your command line. These are:
FREEGLUT_STATIC
_LIB
FREEGLUT_LIB_PRAGMAS=0
You need that FREEGLUT_STATIC to let GLUT know that it's linking statically. Otherwise it looks for a DLL.
I had an older project from VS12 and got the same LNK1104 error when trying to build it after upgrade in VS15. All I had to do to fix this was run Package Manager Console (Tools - NuGet Package Manager) and type in:
Install-Package freeglut
Note, that I have reference to glew.h and freeglut.h in one of my header files like this:
#include "..\packages\nupengl.core.0.1.0.1\build\native\include\GL\glew.h"
#include "..\packages\nupengl.core.0.1.0.1\build\native\include\GL\freeglut.h"

Any possible way to use Tokyo Cabinet in Eclipse?

Just spend 3 straight hours trying to solve the java.lang.UnsatisfiedLinkError: no jtokyocabinet in java.library.path problem in Eclipse in Linux.
Downloaded TC and TC-Java sources,
Built them both using ./config --prefix=/usr (so everything "JNI" related should be in /usr/lib)
Set the LD_LIBRARY_PATH=/usr/lib and CLASSPATH="$CLASSPATH:/usr/local/lib/tokyocabinet.jar" and exported both in .profile
Imported tokyocabinet.jar into the project.
Am I missing a setting other than the proper -Djava.library.path=. settings? I can't even find anything on the net about jtokyocabinet on the web or in the documentation. What's the secret sauce to getting this thing to work?
try to make a link to libjtokyocabinet.so...0 in your JAVA_HOME/jre/lib/i386.
it is because your code can not find tokyocabinet's *.so and *.a files, usually they are in /usr/local/lib, run the following command:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
and then try your code again.
Have the same problem, in my case, using OpenSUSE 12.3 64 bits and Eclipse.
First, the kyotocabinet-java package can be downloaded from this repository:
http://download.opensuse.org/repositories/devel:/libraries:/c_c++/openSUSE_12.3/
This package provide /usr/lib64/libjkyotocabinet.so.1.1.0 that is the library used by the kyotocabinet jar you can get from maven or the official site.
Looking for this lib I found that there is created a slink:
xxxx#xxxx:/usr/lib64> ls -al /usr/lib64/libjkyoto*
/usr/lib64/libjkyotocabinet.so.1 -> libjkyotocabinet.so.1.1.0
/usr/lib64/libjkyotocabinet.so.1.1.0
I just created a new slink without the ".1" at the end...
sudo ln -s libjkyotocabinet.so.1.1.0 libjkyotocabinet.so
/usr/lib64/libjkyotocabinet.so -> /usr/lib64/libjkyotocabinet.so.1.1.0
And all worked alright, seems that
System.loadLibrary("jkyotocabinet");
don't work if the library name is ended with something different to ".so"
Yes, you're missing something. Eclipse controls its own classpath, so whatever you set up in the environment outside Eclipse is likely not to have any effect.
You need to go into the properties for your project, find the "Build Path" settings and add the path to your tc.jar (or jars) to your build path there.
It may be easier to set up a /lib directory within your eclipse project, copy your tokyo jar there and add that to your build path. That way, it becomes part of your project (and can move from Eclipse installation to Eclipse installation) rather than being an external system dependency.

Resources