([\w\.-0-9]+company.com)(?:"|/|<)Example:
find . -name '*.xml' -exec perl -ne '@x=m!([\w\.-0-9]+company.com)(?:"|/|<)!xsmgi;print join("\n",@x), "\n" if @x;' {} \; | sort | uniq
Rants and ravings of a semi-autistic developer who has a hard time remembering idiotic nonsense details. Why remember it, when you know where to find it.
([\w\.-0-9]+company.com)(?:"|/|<)Example:
find . -name '*.xml' -exec perl -ne '@x=m!([\w\.-0-9]+company.com)(?:"|/|<)!xsmgi;print join("\n",@x), "\n" if @x;' {} \; | sort | uniq
Directives %k size in 1K , %b in 512-byte blocks , %s in bytes. %d depth in the directory tree; 0 i.e. the file is a command line argument. %h Leading directories of file's name (all but the last element). %f name with any leading directories removed (only the last element). %p name. %P File's name with the name of the command line argument under which it was found removed. %H Command line argument under which file was found. %F Type of the filesystem the file is on; this value can be used for -fstype. %g group name, or numeric group ID if the group has no name. %G numeric group ID. %i inode number %l Object of symbolic link (empty string if not a symbolic link). %m permission bits (in octal). %n Number of hard links to file. %u owner, or numeric user ID if the user has no name. %U numeric user ID. A % character followed by any other character is discarded (the other character is output).
$ mvn org.myproject.plugins:hello-plugin:hello
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Hello Plugin 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- hello-plugin:1.0-SNAPSHOT:hello (default-cli) @ hello-plugin ---
hello:
[echo] Hello, World
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.410s
[INFO] Finished at: Wed Apr 10 09:53:12 EDT 2013
[INFO] Final Memory: 3M/554M
[INFO] ------------------------------------------------------------------------
Now change the call and add -DantMessageLevel=[info|debug|trace].
$ mvn org.myproject.plugins:hello-plugin:hello -DantMessageLevel=debug
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Hello Plugin 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- hello-plugin:1.0-SNAPSHOT:hello (default-cli) @ hello-plugin ---
Project base dir set to: /Users/tmp
Adding reference: ant.projectHelper
Adding reference: ant.parsing.context
Adding reference: ant.targets
parsing buildfile /var/folders/kh/njhg0wmx1d74cf08gds7jclc0000gp/T/plexus-ant-component5007171426381409971.build.xml with URI = file:///var/folders/kh/njhg0wmx1d74cf08gds7jclc0000gp/T/plexus-ant-component5007171426381409971.build.xml
Setting ro project property: ant.file.null -> /var/folders/kh/njhg0wmx1d74cf08gds7jclc0000gp/T/plexus-ant-component5007171426381409971.build.xml
Project base dir set to: /Users/akaan/tmp
+Target:
+Target: hello
Adding reference: project
Adding reference: session
Adding reference: mojoExecution
Setting ro project property: messageLevel -> debug
Setting ro project property: basedir -> /Users/tmp
Build sequence for target(s) `hello' is [hello]
Complete build sequence is [hello, ]
hello:
[echo] Hello, World
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.413s
[INFO] Finished at: Wed Apr 10 09:55:09 EDT 2013
[INFO] Final Memory: 3M/554M
[INFO] ------------------------------------------------------------------------
Or if you need to pass the configuration item in the plugin definition itself use messageLevel.
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.myproject.tests</groupId>
<artifactId>hello-plugin-tests</artifactId>
<version>1.0</version>
<name>Test Project</name>
<build>
<plugins>
<plugin>
<groupId>org.myproject.plugins</groupId>
<artifactId>hello-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<configuration>
<name>John</name>
<messageLevel>debug</messageLevel>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>one</goal>
<goal>two</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Caused by: javax.xml.bind.MarshalException - with linked exception: [com.sun.istack.internal.SAXException2: unable to marshal type "com.tibco.xmlns.applicationmanagement.ApplicationType" as an element because it is missing an @XmlRootElement annotation] at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:317) at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:243) at org.springframework.oxm.jaxb.Jaxb2Marshaller.marshal(Jaxb2Marshaller.java:626) ... 25 more Caused by: com.sun.istack.internal.SAXException2: unable to marshal type "com.tibco.xmlns.applicationmanagement.ApplicationType" as an element because it is missing an @XmlRootElement annotation at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.reportError(XMLSerializer.java:216) at com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:286) at com.sun.xml.internal.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:462) at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:314) ... 27 more [ERROR]With the XJC bindings we can fix this however can be tedious going thru all the elements.... Boring.... so lets make a oneliner.... Here a one liner that will solve that and will generate the annotation section for your xcj.bindings or jaxb.bindings... Generating the XMLRootElement on bindings (requirements for perl will be XML::Simple see cpan)
perl -MXML::Simple -e 'BEGIN { use Data::Dumper; } $x=XMLin("./src/main/schema/5.5/ApplicationManagement.xsd");foreach (keys %{$x->{"complexType"}}) { printf "<jaxb:bindings node=\"xs:complexType[\@name=%c%s%c]\">
<annox:annotate><annox:annotate annox:class=\"javax.xml.bind.annotation.XmlRootElement\" name=\"%s\"/></annox:annotate></jaxb:bindings>\n",0x27,$_,0x27,$_ if $_; };'
Generates the output on the console:
<jaxb:bindings node="xs:complexType[=ActionType]"><annox:annotate><annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement" name="ActionType"/></annox:annotate></jaxb:bindings> <jaxb:bindings node="xs:complexType[=ServiceType]"><annox:annotate><annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement" name="ServiceType"/></annox:annotate></jaxb:bindings> <jaxb:bindings node="xs:complexType[=ServiceInstanceType]"><annox:annotate><annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement" name="ServiceInstanceType"/></annox:annotate></jaxb:bindings> <jaxb:bindings node="xs:complexType[=anyObject]"><annox:annotate><annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement" name="anyObject"/></annox:annotate></jaxb:bindings> <jaxb:bindings node="xs:complexType[=ApplicationType]"><annox:annotate><annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement" name="ApplicationType"/></annox:annotate></jaxb:bindings> <jaxb:bindings node="xs:complexType[=NVPairType]"><annox:annotate><annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement" name="NVPairType"/></annox:annotate></jaxb:bindings> <jaxb:bindings node="xs:complexType[=RepoInstanceType]"><annox:annotate><annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement" name="RepoInstanceType"/></annox:annotate></jaxb:bindings> <jaxb:bindings node="xs:complexType[=RemoteRepoInstanceType]"><annox:annotate><annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement" name="RemoteRepoInstanceType"/></annox:annotate></jaxb:bindings> <jaxb:bindings node="xs:complexType[=EventType]"><annox:annotate><annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement" name="EventType"/></annox:annotate></jaxb:bindings> <jaxb:bindings node="xs:complexType[=BWServiceType]"><annox:annotate><annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement" name="BWServiceType"/></annox:annotate></jaxb:bindings> Signings-MacBook-Pro:tibco-appmanage-schema $THe end result as a XJC bindings file... which can be included in your XJC generation, in my case the maven plugin:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:annox="http://annox.dev.java.net"
xsi:schemaLocation="http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd"
version="2.1">
<jaxb:bindings schemaLocation="ApplicationManagement.xsd"
node="/xs:schema">
<jaxb:globalBindings generateIsSetMethod="true"
collectionType="java.util.ArrayList">
</jaxb:globalBindings>
<jaxb:bindings node="xs:complexType[@name=ActionType]">
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement"
name="ActionType" />
</annox:annotate>
</jaxb:bindings>
<jaxb:bindings node="xs:complexType[@name=ServiceType]">
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement"
name="ServiceType" />
</annox:annotate>
</jaxb:bindings>
<jaxb:bindings node="xs:complexType[@name=ServiceInstanceType]">
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement"
name="ServiceInstanceType" />
</annox:annotate>
</jaxb:bindings>
<jaxb:bindings node="xs:complexType[@name=anyObject]">
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement"
name="anyObject" />
</annox:annotate>
</jaxb:bindings>
<jaxb:bindings node="xs:complexType[@name=ApplicationType]">
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement"
name="ApplicationType" />
</annox:annotate>
</jaxb:bindings>
<jaxb:bindings node="xs:complexType[@name=NVPairType]">
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement"
name="NVPairType" />
</annox:annotate>
</jaxb:bindings>
<jaxb:bindings node="xs:complexType[@name=RepoInstanceType]">
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement"
name="RepoInstanceType" />
</annox:annotate>
</jaxb:bindings>
<jaxb:bindings node="xs:complexType[@name=RemoteRepoInstanceType]">
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement"
name="RemoteRepoInstanceType" />
</annox:annotate>
</jaxb:bindings>
<jaxb:bindings node="xs:complexType[@name=EventType]">
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement"
name="EventType" />
</annox:annotate>
</jaxb:bindings>
<jaxb:bindings node="xs:complexType[@name=BWServiceType]">
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement"
name="BWServiceType" />
</annox:annotate>
</jaxb:bindings>
</jaxb:bindings>
</jaxb:bindings>
And the declaration of the maven plugin....
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.8.3</version>
<executions>
<execution>
<id>generate-domain1</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<strict>true</strict>
<schemaDirectory>src/main/schema/${schema.version}</schemaDirectory>
<schemaIncludes>
<value>scm-tibco-project.xsd</value>
</schemaIncludes>
<bindingIncludes>
<include>xjc.bindings</include>
</bindingIncludes>
<verbose>true</verbose>
<extension>true</extension>
<args>
<arg>-Xannotate</arg>
<arg>-Xequals</arg>
<arg>-XtoString</arg>
<arg>-XhashCode</arg>
</args>
<generateDirectory>${project.build.directory}/generated-sources/xjc
</generateDirectory>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics</artifactId>
<version>0.6.0</version>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-annotate</artifactId>
<version>0.6.0</version>
</plugin>
</plugins>
</configuration>
</plugin>
wget -O- http://cpanmin.us | perl - -l ~/perl5 App::cpanminus local::libor for non wgetters..
curl -L http://cpanmin.us | perl - -l ~/perl5 App::cpanminus local::libThen:
eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib` echo 'eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`' >> ~/.profileOn Linux Systems
echo 'eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`' >> ~/.bash_profileThis assumes your profile is named .profile, you may need to change that to be .bash_profile, .bashrc, etc. After that you can install modules by saying
cpanm Module::Nameand simply use them the same way you would if the were installed in the root directories. In some cases the install does not work... then you can split things up (for the http_proxy it seems it explicitly needs 'http:' or 'https:'). The second item would add the ignore expired certificate on the wget command.
export http_proxy=http://my.proxy.org:3128 export https_proxy=http://my.proxy.org:3128 export PERL5LIB=~/perl5/lib/perl5/ wget --no-check-certificate -O cpan.pl http://cpanmin.us perl cpan.pl -l ~/perl5 App::cpanminus local::libAt times this even fails and use --force
perl cpan.pl --force -l ~/perl5 App::cpanminus local::lib
1273 pdftk S89E.pdf output S89E.unc.pdf uncompress 1274 sed 's/MediaBox \[0 0 612 792\]/MediaBox \[-70 0 542 812\]/g'< S89E.unc.pdf > S89.resized.pdf
Examples
1301 sed 's/MediaBox \[0 0 612 792\]/MediaBox \[0 70 612 862\]/g'< S89E.unc.pdf > S89.resized.pdf 1304 sed 's/MediaBox \[0 0 612 792\]/MediaBox \[0 -70 612 722\]/g'< S89E.unc.pdf > S89.resized.pdf 1305 sed 's/MediaBox \[0 0 612 792\]/MediaBox \[70 0 682 792\]/g'< S89E.unc.pdf > S89.resized.pdf 1306 sed 's/MediaBox \[0 0 612 792\]/MediaBox \[-70 0 542 792\]/g'< S89E.unc.pdf > S89.resized.pdf
Installed Oracle's instantclient for MacOSX x86_64 editions on oracles download site (login required)
~/Downloads)
$ mkdir -p /System/Library/Oracle/ $ cd /System/Library/Oracle/ $ unzip ~/Downloads/instantclient*.zip .Next linking all of the libraries to the general area.
$ cd /usr/lib $ ls /System/Library/Oracle/instantclient_11_2/*.dylib | xargs -I% -t ln -s % . ln -s /System/Library/Oracle/instantclient_11_2/libnnz11.dylib . ln -s /System/Library/Oracle/instantclient_11_2/libociei.dylib . ln -s /System/Library/Oracle/instantclient_11_2/libocijdbc11.dylib . ln -s /System/Library/Oracle/instantclient_11_2/libsqlplus.dylib . ln -s /System/Library/Oracle/instantclient_11_2/libsqlplusic.dylib .The result symlinked the libraries
$ ls -lrt total 40 lrwxr-xr-x 1 akaan wheel 60 Mar 13 13:15 libsqlplusic.dylib -> /System/Library/Oracle/instantclient_11_2/libsqlplusic.dylib lrwxr-xr-x 1 akaan wheel 58 Mar 13 13:15 libsqlplus.dylib -> /System/Library/Oracle/instantclient_11_2/libsqlplus.dylib lrwxr-xr-x 1 akaan wheel 60 Mar 13 13:15 libocijdbc11.dylib -> /System/Library/Oracle/instantclient_11_2/libocijdbc11.dylib lrwxr-xr-x 1 akaan wheel 56 Mar 13 13:15 libociei.dylib -> /System/Library/Oracle/instantclient_11_2/libociei.dylib lrwxr-xr-x 1 akaan wheel 56 Mar 13 13:15 libnnz11.dylib -> /System/Library/Oracle/instantclient_11_2/libnnz11.dylibFollow the same process for other items
$ cd /usr/lib $ sudo ls /System/Library/Oracle/instantclient_11_2/*.dylib.* | xargs -I% -t ln -s % .Next linking the include header files.
$ cd /usr/include $ sudo ls /System/Library/Oracle/instantclient_11_2/sdk/include/*.h | xargs -I% -t ln -s % .Next linking
sqlplus
$ cd /usr/bin $ sudo ln -s /System/Library/Oracle/instantclient_11_2/sqlplus .And last relink the versioned cntl file
$ cd /usr/lib $ sudo ln -s libclntsh.dylib.11.1 libclntsh.dylib
MacBook-Pro:~ johnsmith$ sqlplus SQL*Plus: Release 11.2.0.3.0 Production on Wed Mar 13 14:15:59 2013 Copyright (c) 1982, 2012, Oracle. All rights reserved. Enter user-name:Next move to the mampstack installation directory under the php area and install the oci8 package, when prompted for the installation of the instantclient use
instantclient,/usr/lib
MacBook-Pro:bin johnsmith$ cd /Applications/mampstack-5.3.22-0 MacBook-Pro:mampstack-5.3.22-0 johnsmith$ cd ./php/bin MacBook-Pro:bin johnsmith$ ./pecl install oci8 downloading oci8-1.4.9.tgz ... Starting to download oci8-1.4.9.tgz (169,255 bytes) .....................................done: 169,255 bytes 10 source files, building WARNING: php_bin /Applications/mampstack-5.3.22-0/php/bin/php appears to have a suffix /bin/php, but config variable php_suffix does not match running: phpize Configuring for: PHP Api Version: 20090626 Zend Module Api No: 20090626 Zend Extension Api No: 220090626 Can't load '/Applications/mampstack-5.3.22-0/perl/lib/5.8.8/darwin-2level/auto/Data/Dumper/Dumper.bundle' for module Data::Dumper: dlopen(/Applications/mampstack-5.3.22-0/perl/lib/5.8.8/darwin-2level/auto/Data/Dumper/Dumper.bundle, 1): Symbol not found: _PL_compiling Referenced from: /Applications/mampstack-5.3.22-0/perl/lib/5.8.8/darwin-2level/auto/Data/Dumper/Dumper.bundle Expected in: dynamic lookup at /Applications/mampstack-5.3.22-0/perl/lib/5.8.8/darwin-2level/Data/Dumper.pm line 36 Compilation failed in require at /usr/bin/../share/autoconf/Autom4te/C4che.pm line 35. BEGIN failed--compilation aborted at /usr/bin/../share/autoconf/Autom4te/C4che.pm line 35. Compilation failed in require at /usr/bin/autom4te line 43. BEGIN failed--compilation aborted at /usr/bin/autom4te line 43. ERROR: `phpize' failed MacBook-Pro:bin johnsmith$
MacBook-Pro:bin$ perl -v This is perl 5, version 12, subversion 3 (v5.12.3) built for darwin-thread-multi-2level (with 2 registered patches, see perl -V for more detail) Copyright 1987-2010, Larry WallComment out the
PERL5LIB definition in /Applications/mampstack-5.3.22-0/scripts/setenv.sh like this:
..... ##### PERL ENV ##### #PERL5LIB="/Applications/mampstack-5.3.22-0/perl/lib/5.8.8:/Applications/mampstack-5.3.22-0/perl/lib/site_perl/5.8.8:/Applications/mampstack-5.3.22-0/perl/lib/5.8.8/darwin-2level:/Applications/mampstack-5.3.22-0/perl/lib/site_perl/5.8.8/darwin-2level" #export PERL5LIB LC_ALL=en_US export LC_ALL .....Close your terminal and startup a new one (flushing the environment); and retry the new settings....
MacBook-Pro:bin johnsmith$ cd /Applications/mampstack-5.3.22-0
MacBook-Pro:mampstack-5.3.22-0 johnsmith$ cd ./php/bin
MacBook-Pro:bin johnsmith$ ./pecl install oci8
downloading oci8-1.4.9.tgz ...
Starting to download oci8-1.4.9.tgz (169,255 bytes)
.....................................done: 169,255 bytes
10 source files, building
WARNING: php_bin /Applications/mampstack-5.3.22-0/php/bin/php appears to have a suffix /bin/php, but config variable php_suffix does not match
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
Please provide the path to the ORACLE_HOME directory. Use 'instantclient,/path/to/instant/client/lib' if you're compiling with Oracle Instant Client [autodetect] : instantclient,/usr/lib
building in /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9
running: /private/tmp/pear/temp/oci8/configure --with-oci8=instantclient,/usr/lib
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i386-apple-darwin11.4.2
checking host system type... i386-apple-darwin11.4.2
checking target system type... i386-apple-darwin11.4.2
checking for PHP prefix... /Applications/mampstack-5.3.22-0/php
checking for PHP includes... -I/Applications/mampstack-5.3.22-0/php/include/php -I/Applications/mampstack-5.3.22-0/php/include/php/main -I/Applications/mampstack-5.3.22-0/php/include/php/TSRM -I/Applications/mampstack-5.3.22-0/php/include/php/Zend -I/Applications/mampstack-5.3.22-0/php/include/php/ext -I/Applications/mampstack-5.3.22-0/php/include/php/ext/date/lib
checking for PHP extension directory... /Applications/mampstack-5.3.22-0/php/lib/php/extensions
checking for PHP installed headers prefix... /Applications/mampstack-5.3.22-0/php/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for Oracle Database OCI8 support... yes, shared
checking PHP version... 5.3.22, ok
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for long int... yes
checking size of long int... 8
checking checking if we're on a 64-bit platform... yes
checking Oracle Instant Client directory... /usr/lib
checking Oracle Instant Client SDK header directory... /usr/include
checking Oracle Instant Client library version compatibility... 11.1
checking for ld used by cc... /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld
checking if the linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no
checking for /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm output from cc object... rm: conftest.dSYM: is a directory
ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin11.4.2 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/include -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/main -I/private/tmp/pear/temp/oci8 -I/Applications/mampstack-5.3.22-0/php/include/php -I/Applications/mampstack-5.3.22-0/php/include/php/main -I/Applications/mampstack-5.3.22-0/php/include/php/TSRM -I/Applications/mampstack-5.3.22-0/php/include/php/Zend -I/Applications/mampstack-5.3.22-0/php/include/php/ext -I/Applications/mampstack-5.3.22-0/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/oci8/oci8.c -o oci8.lo
mkdir .libs
cc -I. -I/private/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/include -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/main -I/private/tmp/pear/temp/oci8 -I/Applications/mampstack-5.3.22-0/php/include/php -I/Applications/mampstack-5.3.22-0/php/include/php/main -I/Applications/mampstack-5.3.22-0/php/include/php/TSRM -I/Applications/mampstack-5.3.22-0/php/include/php/Zend -I/Applications/mampstack-5.3.22-0/php/include/php/ext -I/Applications/mampstack-5.3.22-0/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/oci8/oci8.c -fno-common -DPIC -o .libs/oci8.o
/bin/sh /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/include -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/main -I/private/tmp/pear/temp/oci8 -I/Applications/mampstack-5.3.22-0/php/include/php -I/Applications/mampstack-5.3.22-0/php/include/php/main -I/Applications/mampstack-5.3.22-0/php/include/php/TSRM -I/Applications/mampstack-5.3.22-0/php/include/php/Zend -I/Applications/mampstack-5.3.22-0/php/include/php/ext -I/Applications/mampstack-5.3.22-0/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/oci8/oci8_lob.c -o oci8_lob.lo
cc -I. -I/private/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/include -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/main -I/private/tmp/pear/temp/oci8 -I/Applications/mampstack-5.3.22-0/php/include/php -I/Applications/mampstack-5.3.22-0/php/include/php/main -I/Applications/mampstack-5.3.22-0/php/include/php/TSRM -I/Applications/mampstack-5.3.22-0/php/include/php/Zend -I/Applications/mampstack-5.3.22-0/php/include/php/ext -I/Applications/mampstack-5.3.22-0/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/oci8/oci8_lob.c -fno-common -DPIC -o .libs/oci8_lob.o
/bin/sh /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/include -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/main -I/private/tmp/pear/temp/oci8 -I/Applications/mampstack-5.3.22-0/php/include/php -I/Applications/mampstack-5.3.22-0/php/include/php/main -I/Applications/mampstack-5.3.22-0/php/include/php/TSRM -I/Applications/mampstack-5.3.22-0/php/include/php/Zend -I/Applications/mampstack-5.3.22-0/php/include/php/ext -I/Applications/mampstack-5.3.22-0/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/oci8/oci8_statement.c -o oci8_statement.lo
cc -I. -I/private/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/include -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/main -I/private/tmp/pear/temp/oci8 -I/Applications/mampstack-5.3.22-0/php/include/php -I/Applications/mampstack-5.3.22-0/php/include/php/main -I/Applications/mampstack-5.3.22-0/php/include/php/TSRM -I/Applications/mampstack-5.3.22-0/php/include/php/Zend -I/Applications/mampstack-5.3.22-0/php/include/php/ext -I/Applications/mampstack-5.3.22-0/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/oci8/oci8_statement.c -fno-common -DPIC -o .libs/oci8_statement.o
/bin/sh /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/include -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/main -I/private/tmp/pear/temp/oci8 -I/Applications/mampstack-5.3.22-0/php/include/php -I/Applications/mampstack-5.3.22-0/php/include/php/main -I/Applications/mampstack-5.3.22-0/php/include/php/TSRM -I/Applications/mampstack-5.3.22-0/php/include/php/Zend -I/Applications/mampstack-5.3.22-0/php/include/php/ext -I/Applications/mampstack-5.3.22-0/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/oci8/oci8_collection.c -o oci8_collection.lo
cc -I. -I/private/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/include -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/main -I/private/tmp/pear/temp/oci8 -I/Applications/mampstack-5.3.22-0/php/include/php -I/Applications/mampstack-5.3.22-0/php/include/php/main -I/Applications/mampstack-5.3.22-0/php/include/php/TSRM -I/Applications/mampstack-5.3.22-0/php/include/php/Zend -I/Applications/mampstack-5.3.22-0/php/include/php/ext -I/Applications/mampstack-5.3.22-0/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/oci8/oci8_collection.c -fno-common -DPIC -o .libs/oci8_collection.o
/bin/sh /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/libtool --mode=compile cc -I. -I/private/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/include -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/main -I/private/tmp/pear/temp/oci8 -I/Applications/mampstack-5.3.22-0/php/include/php -I/Applications/mampstack-5.3.22-0/php/include/php/main -I/Applications/mampstack-5.3.22-0/php/include/php/TSRM -I/Applications/mampstack-5.3.22-0/php/include/php/Zend -I/Applications/mampstack-5.3.22-0/php/include/php/ext -I/Applications/mampstack-5.3.22-0/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/oci8/oci8_interface.c -o oci8_interface.lo
cc -I. -I/private/tmp/pear/temp/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/include -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/main -I/private/tmp/pear/temp/oci8 -I/Applications/mampstack-5.3.22-0/php/include/php -I/Applications/mampstack-5.3.22-0/php/include/php/main -I/Applications/mampstack-5.3.22-0/php/include/php/TSRM -I/Applications/mampstack-5.3.22-0/php/include/php/Zend -I/Applications/mampstack-5.3.22-0/php/include/php/ext -I/Applications/mampstack-5.3.22-0/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/temp/oci8/oci8_interface.c -fno-common -DPIC -o .libs/oci8_interface.o
/bin/sh /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/libtool --mode=link cc -DPHP_ATOM_INC -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/include -I/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/main -I/private/tmp/pear/temp/oci8 -I/Applications/mampstack-5.3.22-0/php/include/php -I/Applications/mampstack-5.3.22-0/php/include/php/main -I/Applications/mampstack-5.3.22-0/php/include/php/TSRM -I/Applications/mampstack-5.3.22-0/php/include/php/Zend -I/Applications/mampstack-5.3.22-0/php/include/php/ext -I/Applications/mampstack-5.3.22-0/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -o oci8.la -export-dynamic -avoid-version -prefer-pic -module -rpath /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/modules oci8.lo oci8_lob.lo oci8_statement.lo oci8_collection.lo oci8_interface.lo -lclntsh
cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/oci8.so -bundle .libs/oci8.o .libs/oci8_lob.o .libs/oci8_statement.o .libs/oci8_collection.o .libs/oci8_interface.o -lclntsh
dsymutil .libs/oci8.so || :
creating oci8.la
(cd .libs && rm -f oci8.la && ln -s ../oci8.la oci8.la)
/bin/sh /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/libtool --mode=install cp ./oci8.la /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/modules
cp ./.libs/oci8.so /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/modules/oci8.so
cp ./.libs/oci8.lai /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/modules/oci8.la
----------------------------------------------------------------------
Libraries have been installed in:
/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/oci8-1.4.9/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
during execution
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
running: make INSTALL_ROOT="/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/install-oci8-1.4.9" install
Installing shared extensions: /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/install-oci8-1.4.9/Applications/mampstack-5.3.22-0/php/lib/php/extensions/
running: find "/private/tmp/pear/temp/pear-build-johnsmithUbHMFa/install-oci8-1.4.9" | xargs ls -dils
20501804 0 drwxr-xr-x 3 johnsmith wheel 102 Mar 13 12:40 /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/install-oci8-1.4.9
20502308 0 drwxr-xr-x 3 johnsmith wheel 102 Mar 13 12:40 /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/install-oci8-1.4.9/Applications
20502309 0 drwxr-xr-x 3 johnsmith wheel 102 Mar 13 12:40 /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/install-oci8-1.4.9/Applications/mampstack-5.3.22-0
20502310 0 drwxr-xr-x 3 johnsmith wheel 102 Mar 13 12:40 /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/install-oci8-1.4.9/Applications/mampstack-5.3.22-0/php
20502311 0 drwxr-xr-x 3 johnsmith wheel 102 Mar 13 12:40 /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/install-oci8-1.4.9/Applications/mampstack-5.3.22-0/php/lib
20502312 0 drwxr-xr-x 3 johnsmith wheel 102 Mar 13 12:40 /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/install-oci8-1.4.9/Applications/mampstack-5.3.22-0/php/lib/php
20502313 0 drwxr-xr-x 3 johnsmith wheel 102 Mar 13 12:40 /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/install-oci8-1.4.9/Applications/mampstack-5.3.22-0/php/lib/php/extensions
20502314 384 -rwxr-xr-x 1 johnsmith wheel 194492 Mar 13 12:40 /private/tmp/pear/temp/pear-build-johnsmithUbHMFa/install-oci8-1.4.9/Applications/mampstack-5.3.22-0/php/lib/php/extensions/oci8.so
Build process completed successfully
Installing '/Applications/mampstack-5.3.22-0/php/lib/php/extensions/oci8.so'
install ok: channel://pecl.php.net/oci8-1.4.9
configuration option "php_ini" is not set to php.ini location
You should add "extension=oci8.so" to php.ini
MacBook-Pro:bin johnsmith$
/Applications/mampstack-5.3.22-0/apache2/logs/error_log, it means that your oci8 shared object cannot be loaded by the Apache instance;
[Wed Mar 13 14:02:52 2013] [warn] RSA server certificate CommonName (CN) `signings-macbook-pro.local' does NOT match server name!?
PHP Warning: PHP Startup: Unable to load dynamic library '/Applications/mampstack-5.3.22-0/php/lib/php/extensions/oci8' - dlopen(/Applications/mampstack-5.3.22-0/php/lib/php/extensions/oci8, 9): image not found in Unknown on line 0
Do the following
MacBook-Pro:etc johnsmith$ cd /Applications/mampstack-5.3.22-0/php/etc
MacBook-Pro:etc johnsmith$ vi php.ini
add oci8 extension
.....
; Local Variables:
; tab-width: 4
; End:
;extension=oauth.so
;extension=memcache.so
;extension=uploadprogress.so
extension=apc.so
extension=oci8.so
.....
MacBook-Pro:etc johnsmith$ chmod 755 /Applications/mampstack-5.3.22-0/php/lib/php/extensions/oci8.so
Make sure that the extension is defined at the proper section otherwise it will not load correctly with the same image not found message in the error log (/Applications/mampstack-5.3.22-0/apache2/logs/error_log).
My First Oracle Test OCI8-PHP-MAMP
First the connect string; if you have trouble with the connect string try the tnsping utility (unfortunately not part of the instantclient).
$ tnsping PMI_SVC1_DEV
TNS Ping Utility for Linux: Version 10.2.0.4.0 - Production on 13-MAR-2013 18:26:22
Copyright (c) 1997, 2007, Oracle. All rights reserved.
Used parameter files:
/opt/oracle/product/10.2.0.4/network/admin/sqlnet.ora
Used LDAP adapter to resolve the alias
Attempting to contact (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=[hostname])(PORT=[listener-port])))(CONNECT_DATA=(SERVICE_NAME=[servicename])(SRVR=DEDICATED)))
OK (0 msec)
Finally here an oracle.php file that can be dropped in the /Application//mampstack-5.3.22-0/apache2/htdocs directory.
Open a browser and test the integration