apache+sqlite+php for Arm Linux

Publisher:alpha12Latest update time:2020-01-31 Source: eefocusKeywords:apache  sqlite  php  Arm  Linux Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

After several days of hard work, I finally built an apache+sqlite+php platform on the arm-linux platform.

There are a lot of information about apche and sqlite on the Internet, but there are very few about php for arm-linux. It took a lot of time to install php on the arm platform. So I will post the installation process here, hoping it will be helpful to everyone.

Sqlite for Arm Linux Installation

1. Download sqlite3.3.8: Please go to http://www.sqlite.org/download.html, unzip the downloaded code package, and the sqlite3.3.8 directory will be generated.

2. Modify the configure file and comment out the following statement

#if test "$cross_compiling" = "yes"; then

# { { echo "$as_me:$LINENO:: error: unable to find a compiler for building build tools" >&5#echo "$as_me: error: unable to find a compiler for building build tools" >&2;}

# { (exit 1); exit 1; }; }

#fi

. . .

#else

# test "$cross_compiling" = yes &&

# { { echo "$as_me:$LINENO:: error: cannot check for file existence when cross compiling" >&5

#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}

# { (exit 1); exit 1; }; }

. . .

#else

# test "$cross_compiling" = yes &&

# { { echo "$as_me:$LINENO:: error: cannot check for file existence when cross compiling" >&5

#echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}

# { (exit 1); exit 1; }; }

3. Configuration

./configure –prefix=/data0/sqlite --disable-tcl --host=arm-linux

4. Modify the Makefile

Change BCC = arm-linux-gcc -g -O2 to BCC = gcc -g -O2

5. Modify the Makefile file and compile the sqlite3 program as a statically linked library

First you need to add libsqlite3.a compilation

Then sqlite3$(TEXE): $(TOP)/src/shell.c .libs/libsqlite3.la sqlite3.h

Change to lite3$(TEXE): $(TOP)/src/shell.c .libs/libsqlite3.a sqlite3.h

-o $@ $(TOP)/src/shell.c .libs/libsqlite3.la

Change to -o $@ $(TOP)/src/shell.c .libs/libsqlite3.a

6. Make

7. #arm-linux-strip sqlite3

8. Upload sqlite3 to the terminal

9. Sqlite3 program test

sqlite3 test

,if you see the following messages:

SQLite version 3.3.8

Enter ".help" for instructions

sqlite>

input some commands to do something,

sqlite> create table tbl(one varchar(10),two smallint);

sqlite> insert into tbl values('hello',10);

sqlite> insert into tbl values('goodbye',20);

sqlite> .quit

10. Test C program

argv[i] ? argv[i] : "NULL") 

}  printf  ("n"  ) ; return 0; } 
int main(int argc, char **argv  ){  sqlite3 *db  ;  char *zErrMsg = 0;  int  rc;  if( argc != 3 ){  fprintf  (stderr, "Usage :  %s DATABASE SQL-STATEMENTn", argv[0]);  exit(1);  }  rc = sqlite3_open(argv[1], &db);  if( rc ){  fprintf(stderr, "Can't open database: %sn", sqlite3_errmsg(db));  sqlite3_close(db);  exit(1);  }  rc = sqlite3_exec(db, argv[2], callback, 0, &zErrMsg);  if( rc !=SQLITE_OK ){  fprintf(stderr, "SQL error: %sn", zErrMsg);  sqlite3_free(zErrMsg);  }  sqlite3_close(db);  return 0;  }




























#arm-linux-gcc test.c -L.libs -lsqlite3 –static

#arm-linux-strip a.out

Upload the a.out program to the terminal and execute

#a.out test "select * from tbl"

one = hello

two = 10

one = goodbye

two = 20

Apache Server for ARM Linux

1. Download apache_1.3.39.tar.gz from http://www.apache.org/  , unzip it into a directory, and then change to the apache_1.3.39 directory.

2. Use local gcc to compile this version and run:

./configure

After make is completed, no make install is needed

3. Then create a new directory for compiling the arm version, unzip apache_1.3.39.tar.gz in that directory, go to apache_1.3.39 in that directory, and run:

export CC="arm-linux-gcc"

./configure --prefix=/data0/apache/ --without-execstrip --enable-module=so

Then run the make command. The compilation will fail at apache_1.3.39/src/main/gen_test_char because the arm version of the program cannot run on the local machine. You need to overwrite the arm version with the previously compiled local version of apache_1.3.39/src/main/gen_test_char, and then switch to the arm version of apache_1.3.39 to continue make. Then compile another program apache_1.3.39/src/main/gen_uri_delims and the same problem will occur. Use the local version to overwrite it and continue make until the compilation is successful.

4. --prefix=/data0/apache / specifies the installation directory as /data0/apache/. Run make install. All compiled arm version apache programs are installed in the /data0/apache/ directory. Compress this directory, upload it to the terminal, and then modify the conf/httpd.conf configuration file.

5. Note that you need to modify conf/httpd.conf and add ServerName  www.willfar-ertu.com:80 . Otherwise, a warning will be reported when starting the service: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

6. Execute the following command to determine whether Apache is installed successfully.  http://IP:80  If the Apache description page is displayed, it means that the installation is successful. If a 403 error message appears, please confirm whether the Apache directory permission is 755, including the parent directory of Apache.

PHP for ARM Linux

1. Download php-4.4.8.tar.gz from http://www.php.net  , unzip it, and then go to the php-4.4.8 directory.

2. export CC="arm-linux-gcc"

3. Modify the configure file and comment out the cross-compilation error handling, for example:

#if test "$cross_compiling" = yes; then

# { echo "configure: error 7: can not run test program while cross compiling" 1>&2; exit 1; }

#else

4 ./configure --prefix=/data0/php --with-apxs=/data0/apache/bin/apxs --enable-pdo=shared --with-sqlite=shared --with-pdo-sqlite=shared --with-zlib --host=arm-linux --enable-track-vars --with-xml

5. When executing ./configure, some errors will be reported. According to the error prompts, modify the configure file to comment out the error handling until it succeeds.

6. Modify the Makefile file and change

EXTRA_LIBS = -lcrypt -l -lcrypt -lz -lm -lcrypt –lcrypt

Replace with

at http://ip/index.php , it means PHP is installed successfully.

PHP Version 4.4.8

System 
Linux localhost 2.4.18-rmk7-pxa1 #2 Thu Dec 27 12:28:52 CST 2007 armv4l

Build Date 
Feb 3 2008 11:58:44

Configure Command 
'./configure' '--prefix=/data0/php' '--with-apxs=/data0/apache/bin/apxs' '--enable-pdo=shared' '--with-sqlite=shared' '--with-pdo-sqlite=shared' '--with-zlib' '--host=arm-linux' '--enable-track-vars' '--with-xml'

Server API 
Apache

Virtual Directory Support 
disabled

Configuration File (php.ini) Path 
/data0/php/lib

PHP API 
20020918

PHP Extension 
20020429

Zend Extension 
20050606

Debug Build 
no

Zend Memory Manager 
enabled

Thread Safety 
disabled

Registered PHP Streams 
php, http, ftp, compress.zlib

Combining PHP with sqlite3

First download the php-sqlite3 compressed package from the php website

1. Unzip the compressed package to a directory. 
2. Enter the directory and run /data0/php/bin/phpize 
3../configure --with-php-config=/data0/php/bin/php-config --with-sqlite3=your sqlite3 installation directory 
4.make 
5.make install 
6. Put the generated sqlite3.so in the php extension directory. 
7. Load the sqlite3.so module in php.ini


Keywords:apache  sqlite  php  Arm  Linux Reference address:apache+sqlite+php for Arm Linux

Previous article:ARM bare metal article--serial UART experiment
Next article:ARM architecture and system structure

Recommended ReadingLatest update time:2024-11-16 12:48

Application of ARM7 and FPGA in industrial control and fault detection
Industrial control often requires multi-channel fault detection and multi-channel command control (this multi-task setting is very common). A single CPU chip is difficult to directly complete multi-channel inspection and control tasks due to its limited number of external control interfaces. Therefore, it is a very go
[Microcontroller]
Application of ARM7 and FPGA in industrial control and fault detection
s3c2440 LCD screen driver (built-in kernel) linux-4.1.24
It comes with some driver configuration information. Just modify this part to support different LCD screens - /arch/arm/mach-s3c24xx/mach-smdk2440.c The other part is in /drivers/video/fbdev/s3c2410fb.c First turn on the debugging function so that the kernel can output this information when it starts, or use dmesg
[Microcontroller]
s3c2440 LCD screen driver (built-in kernel) linux-4.1.24
The UK has further increased sanctions on Russia, prohibiting Russian manufacturers from obtaining ARM architecture licenses
According to Russian media reports, the UK has expanded sanctions against Russia to include domestic MCST processors and Baikal Electronics. In addition to freezing their assets, the sanctions also prohibit British companies from providing technical services to Russia. Therefore, Baikal Electronics, Russia's most fa
[Semiconductor design/manufacturing]
Technical principles and functional implementation of Hongrun NHR-7630R in natural gas energy measurement
1. Abstract As an available energy source, the core value of natural gas lies in the output of heat. The traditional volume measurement method for trade transfer pricing cannot reflect the advantages and disadvantages of natural gas with different qualities in terms of calorific value. Natural gas energy measurement f
[Test Measurement]
Technical principles and functional implementation of Hongrun NHR-7630R in natural gas energy measurement
How to use ARM serial port (UART) (S3C2440)
UART Overview Universal Asynchronous Receiver and Transmitter (UART) Working mode: serial, full-duplex. Only 3 wires are needed: TXD (transmit data), RXD (receive data), GND. Data transmission process: It was originally high level (idle state) The sender pulls the level low and holds it for 1 bit, which is the sta
[Microcontroller]
How to use ARM serial port (UART) (S3C2440)
How does the kernel compile zImage under the Arm architecture?
make -f scripts/Makefile.build obj=arch/arm/boot MACHINE=arch/arm/mach-s3c6400/ arch/arm/boot/zImage First, some segments of vmlinux are removed and the Image is generated, such as .comment. arm-linux-objcopy -O binary -R .note -R .note.gnu.build-id -R .comment -S  vmlinux arch/arm/boot/Image   Kernel: arch/arm/boo
[Microcontroller]
Changes in power management methods in the new version of Linux system device architecture of linux driver power management
Changes in power management methods in the new version of Linux system device architecture based on linux-2.6.32   1. Power management part of each data structure of the device model   The Linux device model is jointly described through many structures, such as struct device, struct device_type, struct class, struct d
[Microcontroller]
Application of FARO Platinum Arm in workpiece measurement in the welding workshop of a truck factory
FAW Jiefang Automobile Co., Ltd. (hereinafter referred to as FAW Jiefang Company) was established on January 18, 2003. It is a medium and heavy-duty truck manufacturing enterprise reorganized by China First Automobile Group Corporation based on the main professional factory of the original First Automobile Factory, in
[Test Measurement]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号