×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: PAMP + SQLite

  1. #1
    Registered User
    Join Date
    Jan 2009
    Posts
    7

    PAMP + SQLite

    Anyone know how to get work SQLite PHP extension in PAMP?

    MySQL is good but httpd with mysqld eating more memory on my N95-1. Sqlite more gentle with memory because no server only lib.

    Need full help about how to install ext_sqlite into PAMP.

    Help anyone!!!

    P.S. Sorry for bad english - no long to practice...

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: PAMP + SQLite

    Quote Originally Posted by darkarren View Post
    Anyone know how to get work SQLite PHP extension in PAMP?
    Can you build from the source? That is, do you know how to build and compile software in the Symbian environment. If you do, I can provide instructions for what needs to be done.

    Br,
    Johan

  3. #3
    Registered User
    Join Date
    Jan 2009
    Posts
    7

    Re: PAMP + SQLite

    I ready for receive instruction set, I was built php but for windows/linux, not for symbian.

    I want to reduce size of php library in the memory by switching off unused components like mysql, mysqli and curl or other... (only SQLite is needed and php for extrasmall site on my own smartphone)

    Can you wrote me to an ICQ:292420094 for detail discussion.
    // I found some files, that will help me with selecting of components to build in.

  4. #4
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: PAMP + SQLite

    Quote Originally Posted by darkarren View Post
    I ready for receive instruction set, I was built php but for windows/linux, not for symbian.

    I want to reduce size of php library in the memory by switching off unused components like mysql, mysqli and curl or other... (only SQLite is needed and php for extrasmall site on my own smartphone)
    Ok, here we go.

    Get the PAMP source and build the software following the instructions found here. Start making changes only after you have successfully built the unmodified software.

    In the following, all paths are relative to pamp/php-5.2.2.

    Building PHP
    After you have built everything once, you can switch to building just PHP.

    • Enter symbian/group
    • bldmake bldfiles
    • abld build armv5 urel


    Dropping an extension
    In symbian/components_symbian.h simply comment away the define corresponding to the extension you want to drop.

    Adding an extension
    Select an appropriate define for the extension.
    • Add the define to symbian/components_symbian.h
    • Add relevant sections to main/internal_functions.c. The contents of the file should provide you with enough hints for what needs to be added.
    • Add a build-file for the extension to the directory symbian/group/ext. Look for examples in the existing files.
    • Add a section for the new extension in symbian/group/modules.mmp.
    • Add the build-file to symbian/group/bld.inf

    Build.

    NOTE When you modify a bld.inf file you must issue the bldmake bldfiles command.

    Adding sqlite
    The sqlite extension is located in ext/sqlite and sqlite itself seems to included in ext/sqlite/libsqlite. You need to experiment exactly which files you need to include and figure out what kind of modifications, if any, you need to make.

    Br,
    Johan

  5. #5
    Registered User
    Join Date
    Jan 2009
    Posts
    7

    Re: PAMP + SQLite

    I received an error while try to build something.

    # bldmake bldfiles
    ^-- here not all ok, but I solved the problems
    # abld build armv5 urel
    ^-- it says: This project does not support platform, build or program "ARMV5" o_O

    I install everything that you need to build, but do not understand that needs to be and why can not build for ARMV5.

    Tell me: where and what should be?
    - EPOCROOT
    - EPOCPATH
    - Why can not ARMV5

    ((((((((((((((
    Last edited by darkarren; 2009-02-01 at 11:38.

  6. #6
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: PAMP + SQLite

    Quote Originally Posted by darkarren View Post
    I install everything that you need to build, but do not understand that needs to be and why can not build for ARMV5.
    In order to use the armv5 build target, you need to have the RVCT compiler. I'm sorry, I should have been more clear about that.

    Br,
    Johan

  7. #7
    Registered User
    Join Date
    Jan 2009
    Posts
    7

    Re: PAMP + SQLite

    Damn!
    Where can I download this compiler? I was looking on the pages, but did not find one!
    There are only patches, look here: http://arm.com/support/downloads/devtoolsdownloads.html

    please... give me "link for one click", where I can get it

    later:
    // I found "RealView Development Suite" on 'https://silver.arm.com', but it is not free o_O
    // Do you have an alt ways to build it?

    more later:
    // So... I can't get RVCT because no links but only registration and patches or updates.
    // Can you download it for me or other way to get it for me? I realy have a troubles with it.

    more-more later:
    I tried to compile using GCCE instead ARMV5, but it gives this:
    Code:
    WARNING: Can't find following headers in System Include Path
      <string.h> <wchar.h> <pthread.h> <math.h> <time.h> <sys\signal.h> <sys \ select.h
    > <pthread.h> <stdio.h> <stdlib.h> <math.h> <sys\types.h> <fcntl.h> <sys\time.h>
      <time.h> <unistd.h> <errno.h> <crypt.h> <assert.h> <sys\socket.h> <strings.h> <
    string.h> <strings.h> <memory.h> ... etc.
    Where from I can take this files?
    ______________________________________________
    Last edited by darkarren; 2009-02-03 at 10:17.

  8. #8
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: PAMP + SQLite

    Quote Originally Posted by darkarren View Post
    Where can I download this compiler?
    There's the problem, it's a commercial product that must be bought. It's not available for free.
    Where from I can take this files?
    They are available in epoc32/include/stdapis.

    Br,
    Johan

  9. #9
    Registered User
    Join Date
    Jan 2009
    Posts
    7

    Re: PAMP + SQLite

    Quote Originally Posted by jhnwkmn View Post
    There's the problem, it's a commercial product that must be bought. It's not available for free.
    Br,
    Johan
    So I will not be able to collect anything myself... But you can! Let's try to find out that need and what do not need?

    They are available in epoc32/include/stdapis.
    I have no epoc32/include/stdapis! o_O But I install all... or not?

  10. #10
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: PAMP + SQLite

    Quote Originally Posted by darkarren View Post
    I have no epoc32/include/stdapis! o_O But I install all... or not?
    If that's the case, then you probably did not install Open C.

    Johan

  11. #11
    Registered User
    Join Date
    Jan 2009
    Posts
    7

    Re: PAMP + SQLite

    Excellent! I had already guessed Well, Well ... try to compile all this with a GCCE
    Then write about the results, I hope everything turned out...

  12. #12
    Registered User
    Join Date
    Nov 2008
    Posts
    24

    Re: PAMP + SQLite

    Quote Originally Posted by darkarren View Post
    Excellent! I had already guessed Well, Well ... try to compile all this with a GCCE
    Then write about the results, I hope everything turned out...
    Have you succeded in adding MySQLite?
    I'm trying to do the same adding SOAP to PHP.

    As probably you are doing, I'm using GCCE as I'm a phD student and this will be a prototype, so I don't need ARMV5 efficiency (I saw somewhere that's the difference, excluding price :P )

    While building (abld build gcce urel), I get some errors:

    ..//..//..//..//Symbian//9.1//S60_3rd_MR_3//EPOC32//include/e32def.h:2769: error: initializer element is not constant
    make[1]: *** [..\..\..\..\Symbian\9.1\S60_3rd_MR_3\EPOC32\BUILD\pamp-1.0.2_rc1\php-5.2.2\symbian\group\PHP_TSRM\GCCE\UREL\TSRM.o] Error 1
    make: *** [TARGETPHP_TSRM] Error 2
    make -r -f "\Symbian\9.1\S60_3rd_MR_3\EPOC32\BUILD\pamp-1.0.2_rc1\php-5.2.2\symbian\group\GCCE.make" FINAL CFG=UREL VERBOSE=-s


    As the build is not done, the creation of the SIS file doesn't go further either (this is the PHP example, but also happens when doing in the complete PAMP project):
    C:\PAMP-1~1.2_R\PHP-52~1.2\symbian\sis>make PLATFORM=gcce BUILD=urel CERTIFICATE=C:\firmar\certificado.csr KEY=C:\firmar\clave.key PASSPHRASE=******** sis
    x
    C:/Symbian/9.1/S60_3rd_MR_3/epoc32/tools/make.exe -f mod_php.mk\
    PLATFORM="gcce" BUILD="urel"\
    CERTIFICATE="C:\firmar\certificado.csr" KEY="C:\firmar\clave.key" PASSPHRASE="1234"\
    sisx
    make.exe[1]: Entering directory `C:/PAMP-1~1.2_R/PHP-52~1.2/symbian/sis'
    make.exe[1]: *** No rule to make target `C:/Symbian/9.1/S60_3rd_MR_3/epoc32/release/gcce/urel/httpd22-mod_php.so', needed by `mod_php_gcce_urel.sisx'.
    Stop.
    make.exe[1]: Leaving directory `C:/PAMP-1~1.2_R/PHP-52~1.2/symbian/sis'
    C:\Symbian\9.1\S60_3rd_MR_3\epoc32\tools\make.exe: *** [mod_php] Error 2


    I know the problem is located in the building step, but, I would appreciate some help

  13. #13
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: PAMP + SQLite

    e32def.h:2769: error: initializer element is not constant
    You can probably work around that by adding
    Code:
    MACRO __REMOVE_PLATSEC_DIAGNOSTIC_STRINGS__
    to the mmp-files. Or then, if you don't want to touch the mmp-files, you can edit e32def.h and simply comment out the assignment.
    Code:
    static const char* const KSuppressPlatSecDiagnostic; // = KSuppressPlatSecDiagnosticMagicValue;
    Note that I originally used gcce for building Apache and there was a number of problems that needed to be worked around. Initially a gcce built Apache simply did not run. So, when you get php to build, you may be in for some debugging before it loads and runs.

    Br,
    Johan

  14. #14
    Registered User
    Join Date
    Nov 2008
    Posts
    24

    Re: PAMP + SQLite

    Quote Originally Posted by jhnwkmn View Post
    Note that I originally used gcce for building Apache and there was a number of problems that needed to be worked around. Initially a gcce built Apache simply did not run. So, when you get php to build, you may be in for some debugging before it loads and runs.
    And those problems don't exist with ARMV5?

    So, if I build the PAMP source code with GCCE I will not be able to run it directly (without modifications), but it would with ARMV5.

    My goal is to use SOAP, and I though that, through PHP, that would be already implemented or easy to deploy , but I still can try again with SOAPpy and check some dependencies that I was missing (that's why I moved to PAMP)

    Thank you very much Johan, how can you be that fast answering?

  15. #15
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    457

    Re: PAMP + SQLite

    Quote Originally Posted by didacgil9 View Post
    And those problems don't exist with ARMV5?
    No

    Actually, the problems seems to be related to the use of the ABIv2 toolchain because the problems also appear if you build using the armv5_abiv2 target (that uses the RVCT compiler).

    You can find details about the different ABIs here.

    So, if I build the PAMP source code with GCCE I will not be able to run it directly (without modifications), but it would with ARMV5.
    We can't know that before you try

    It used to be (it's been a while since I used gcce) so that if a DLL contained a function pointer variable with static storage duration that was initialized with the address of a function in another DLL, then an application linking to that DLL simply would not start. For instance, if there in the DLL's code is something like:
    Code:
    void *(*my_malloc)(size_t) = malloc;
    then the application statically linking to that DLL would not start if the DLL had been built using gcce. The workaround is simple
    Code:
    static void local_malloc(size_t size)
    {
      return malloc(size);
    }
    
    void *(*my_malloc)(size_t) = local_malloc;
    but it's not exactly easy to find problems like this, since you get no indication of any kind what and where the problem is.

    So, if you succeed in building mod_php using gcce and the loading of mod_php fails, without any code in mod_php being run, then there may be some code like that in mod_php, or any of its libraries, that must be fixed.

    Another problem was that it seemed that if a gcce-built DLL contains too much data with static storage duration, then some fixups are not applied correctly at load time, with the result of initialized pointers inside the DLL pointing totally wrong, which leads to code in the DLL crashing very quickly. But you can't know without trying whether it'll work or not.

    Thank you very much Johan, how can you be that fast answering?
    I tend to follow the mobile web server threads

    Johan

Similar Threads

  1. SQLite for Symbian OS v9.1 S60? PySQLite
    By shoot.spam in forum Open C/C++
    Replies: 4
    Last Post: 2009-06-08, 07:08
  2. Using PAMP over GPRS ?
    By castro145 in forum Mobile Web Server
    Replies: 1
    Last Post: 2008-09-01, 06:52
  3. PAMP install woes
    By eliotphillips in forum Mobile Web Server
    Replies: 3
    Last Post: 2008-08-14, 09:02
  4. [moved] PAMP & PEAR?
    By Grismar in forum Mobile Web Server
    Replies: 1
    Last Post: 2008-07-14, 08:32
  5. PAMP 1.0.0 Available
    By jhnwkmn in forum Mobile Web Server
    Replies: 2
    Last Post: 2008-05-26, 12:57

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •