Learning PHP5/MySQL Programming

原创 2008年09月29日 15:01:00


1.set Apache MySQL PHP environment

2.Turn on register-globals in the PHP.INI to retrieve the data from another php page

3.php_nuke install

4.install Perl interpreter in php.

5.some small problems you may meet and some tricks

I learned PHP5/MySQL Programming this summer,used this book :
PHP5/MySQL Programming for absolutely beginner , by ANDY HARRIS .
This book may be a little boring for someone who has some experiences of html ,
java and perl programming , but it gives many examples of PHP and MySQL
programming, gives readers the whole impression of a php project,the handbooks
of php and MySQL can not help you in this way.

I wasted a lot of time in setting php programming environment. Here I would
like to show some of my solutions of environment exploring.I hope them can
save your time.

1.set Apache MySQL PHP environment

My operation system is ubuntu 7.10, I found a wonderful guide of LAMP.

InstallingLAMP on Ubuntu 7.10/8.04 (Linux,Apache,MySQL,PHP)

Read it carefully,you can get many helpful information.

There is a mistake in the guide : when you run the php file < ? echo "hello,world!" ?>

make sure there is no space between “<” and ” ?”.


some useful instructions

stop apache : sudo /etc/init.d/apache2 stop

start apache : sudo /etc/init.d/apache2 start

restart apache : sudo /etc/init.d/apache2 restart

run mysql : mysql -u***** -pXXXXX *****=username XXXXX = password

edit anfile with root authority : sudo gedit /.......

If you can not open a file or some image,the most probability is you do no
have authority.You can change authority with chmod command:

sudochmod (-Rc ) 777 /.....

the path of php directory : /var/www/


If your operation system is windows,the precess would be much easier.

Enter this site http://www.appservnetwork.com/,

Just download appserv and install it.



2.Turn on register-globals in the PHP.INI to to retrieve the data


Some PHP servers have turned off the ability to automatically create avariable

from a form. You might be able to convince your server administrator to turn on

register_globals in the PHP.INI file.If not, here’s a workaround: If your form

has a field called userName, add this code to the beginning of the program that

needs the value of that field:

$userName= $_REQUEST[“userName”];

Repeat this code for every variable you wish to pull from the original form.

For a complete explanation of this code, skip to chapter 5, “Better Arrays and

String Handling.” In that chapter you also find a routine for automatically

extracting all a form’s fields, even if you don’t know the field names.


The path of php.ini : /etc/php5/apache2 (sudo gedit/etc/php5/apache2/php.ini)

The path of httpd.conf : /etc/apache2/ (sudo gedit/etc/apache2/httpd.conf)


3.php_nukeinstall

1.)download php_nuke 8.0 from

http://phpnuke.org/modules.php?name=Downloads&d_op=search&
query=phpnuke%208.0
(enter 8.0 in search field to search .)

(Now php_nuke 8.1 is not free)

2.)set php_nuke follow this:

http://www.phpnuke.org.cn/modules.php?name=News&file=article&sid=101

(It's Chinese ,you can choose lunguage in English. )

4.install Perl interpreter in php.


(if you meet this error in the precess: /usr/bin/phpize: No such file ordirectory

run this command: sudo apt-get install php5-dev)

There are two ways:

  1. (1.)sudo apt-get install php5-cgi

    (2.) sudo apt-get install php5-pear

(3.)sudo /usr/bin/pecl login

(if you meet this warnning like this : Linking the shared library perl.la

against the static library/usr/lib/perl/5.8//auto/DynaLoader/DynaLoader.a

is not portable.You can run this command : sudo apt-get install libperl-dev )

(4.)sudo/usr/bin/pecl install perl


  1. (1.)download perl-1.0.0.tgz from http://pecl.php.net/package/perl

(2.)decompress it,and follow the 3 steps of the readme file

(if you meet this warnning like this : Linking the shared library perl.la against

the static library/usr/lib/perl/5.8//auto/DynaLoader/DynaLoader.a is not

portable.You can run this command : sudo apt-get install libperl-dev )



5.some small problems you may meet and some tricks:

1)When you can not open a file ,make sure the authority is right.

2)You may open a image file failed,make sure you have the right authority,

and you can run php file

< ? phpInfo(); ?>

(make sure there is no space between “<” and ” ?”)

to find outwhether that kind of image is supported by php.

You can run this command to install gd package ,then many kinds of image files

would be supported:

sudo apt-get install php5-gd

3)You may find you can log in Http://127.0.0.1but can not log in Http://localhost,

insert into /etc/hosts with this line:

127.0.0.1 localhost

may help you.

4)If you import an XML file in php but meet this error: “ XML declaration allowed

only at the start of the document “ ,make sure the first line of XML is ,no space line.

5)download handbooks of php and mysql, you will need them.



_______________________________________________END

May this help you!

Thanks for your advices!

Github上的1000多本免费电子书重磅来袭!

这个GIthub库的免费电子书资源绝对值得你拥有,赶紧收藏吧! 以前 StackOverFlow 也给出了一个免费电子书列表,现在在Github上可以看到时刻保持更新的列表了。 瞥一眼下面的书籍分类目...
  • napoleonjk
  • napoleonjk
  • 2014年08月11日 14:31
  • 11825

ROS(1和2)机器人操作系统相关书籍、资料和学习路径

ROS机器人相关书籍与资料(更新日期2017年10月)ROS发展10年了,已经逐渐成为通用的机器人操作系统标准。之前写过一篇博文总结过相关书籍(流行版本和相关书籍汇总),但是并没有具体介绍。学习ROS...
  • ZhangRelay
  • ZhangRelay
  • 2017年10月09日 08:41
  • 4672

Coursera机器学习 week5 神经网络的学习 编程作业代码

这是Coursera上Week6的神经网络的学习部分的编程作业代码。经过测验,全部通过。下面是 sigmoidGradient.msigmoidGradient.m 的代码:% sigmoidGrad...
  • Artprog
  • Artprog
  • 2016年05月21日 09:39
  • 4279

PHP5.MySQL.Programming.for.absolute.beginner.zip

  • 2008年10月07日 12:53
  • 5.91MB
  • 下载

Packt.Publishing.Object.Oriented.Programming.with.PHP5.Dec.2007

  • 2008年03月16日 08:39
  • 4.69MB
  • 下载

PHP5 Power Programming

  • 2008年11月13日 22:40
  • 9.4MB
  • 下载

CentOS 6.5安装配置LAMP服务器(Apache+PHP5+MySQL)

  • 2015年11月24日 16:48
  • 306KB
  • 下载

Beginning PHP5, Apache, And MySQL Web Development

  • 2009年08月14日 13:12
  • 13.7MB
  • 下载

PHP5_MySQL宝典

  • 2007年04月29日 01:17
  • 16.46MB
  • 下载

PHP5.and.MySQL.Bible.eBook

  • 2007年09月16日 09:21
  • 5.51MB
  • 下载
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Learning PHP5/MySQL Programming
举报原因:
原因补充:

(最多只允许输入30个字)