在IOS中搭建web服务器和PHP开发环境:Lighttpd + PHP(with GD) + My
(2012-11-22 15:25:56)
标签:
ioslighttpdphpgd库mysql |
分类: iPhone |
1. Install the Package in
Cydia
Add the Cydia Source
2. Mysql Configuration
Log in your IOS device and execute
#
bin/mysql_install_db --user=daemon
#
/usr/local/bin/mysqladmin -u root password
'new-password'
#
/usr/local/bin/mysql_secure_installation
Change
the root password? [Y/n]
Remove anonymous users?
[Y/n] y
Disallow root login remotely? [Y/n]
n
Remove test database and access to it? [Y/n]
y
Reload privilege tables now? [Y/n] n
# mysql -u root
-p"yourpassword"
Welcome to the MySQL
monitor.
Your MySQL connection
id is 8
Server version: 5.1.66 Source
distribution
Copyright (c) 2000, 2012, Oracle
and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or
its
affiliates. Other names may be trademarks of
their respective
owners.
Type
'help;' or '\h' for help. Type '\c' to clear the current input
statement.
mysql>
mysql>
mysql> show
databases;
+--------------------+
|
Database
+--------------------+
|
information_schema |
| mysql
+--------------------+
2 rows
in set (0.01 sec)
mysql>
3. PHP Configuration
Create File: /etc/php.ini
;This
;Be
mysql.default_socket
pdo_mysql.default_socket
mysqli.default_socket
;Limits
upload_max_filesize
post_max_size
;TimeZone
;You
;The
date.timezone
;I
recommends to place following lines
to
;from
;========================================================================================
;Please
;It
;Make
;Make
log_errors=Off
error_log=/var/log/lighttpd/php_scripts_error.log
;To
;Have
expose_php=Off
;Do
;
;The
;include
and require statements - can retrieve data from remote locations
using ftp or http
;protocols.
Programmers frequently forget this and don't
;user-provided
data to these functions,
;A
large number of code injection vulnerabilities
reported
;caused
;
;I
also recommend to disable
allow_url_include
;
;If
;Please
;application
such
;
;It
;as
;custom
filtering functions serve a better
purpose
;
;You
;Another
;may
spend parsing request data,
;GD
picture converting needs a lot of memory.
;Set
;
;
;
The packages include configuration files for PHP
in
Create File:
/etc/php.d/php.ini
;You
;If
;order
of INI files
extension=iconv.so
extension=mbstring.so
extension=curl.so
;The
extension=sqlite3.so
extension=pdo_sqlite.so
;The
extension=mysqlnd.so
extension=mysqli.so
extension=mysql.so
extension=pdo_mysql.so
;Must
extension=exif.so
extension=gd.so
extension=zip.so
extension=bz2.so
extension=calendar.so
extension=mcrypt.so
extension=xsl.so
extension=openssl.so
PHP Version 5.4.8 |
|
System |
Darwin mengtaos-iPhone 10.4.0 Darwin Kernel Version 10.4.0: Wed Oct 20 20:08:31 PDT 2010; root:xnu-1504.58.28~3/RELEASE_ARM_S5L8920X iPhone2,1 |
|
Build Date |
Nov 14 2012 17:33:08 |
|
Configure Command |
'./configure' |
|
Server API |
CGI/FastCGI |
|
Virtual Directory Support |
disabled |
|
Configuration File (php.ini) Path |
/etc |
|
Loaded Configuration File |
/etc/php.ini |
|
Scan this dir for additional .ini files |
/etc/php.d |
Now, Enjoy this little web server!

加载中…