Compilingphpwithcrypt()

 更新时间:2016年11月25日 16:33  点击:1983
Compiling php with crypt()
author:
Daniel Beulshausen
updated:
14.10.2000


This quick tutorial shall help you to compile php with support for the crypt() function, because it's not correct that if you use windows you can't use crypt().
It is however correct that libcrypt isn't available by default on windows, but you can use the libary from our download section.
Extract the zip and move crypt.h to your include folder, and the needed libary (release or debug) to your libary folder (tools -> options -> folders).
Load the php workspace, and add crypt.c (can be found in ext/standard/) to the php4dllts group (you can put crypt.c to Function Modules -> Source Files).
Now edit the link options of the php4dllts project, and add libcrypt to the link libaries, note that we compiled a release and a debug libary, please use only release for the release builds, and the debug libary for debug builds!
Now edit config.w32.h (located in main/), edit it and change the needed defines:
#define HAVE_CRYPT 1
#define HAVE_CRYPT_H 1
This should do the trick, and it'll build you php with the crypt() function. 
JAVA是个非常强大的编程利器,它的扩展库也是非常的有用,这篇教程,主要讲述怎样使用PHP调用功能强大的JAVA 类库(classes)。为了方便你的学习,这篇教程将包括JAVA的安装及一些基本的例子。
windows下的安装
第一步:安装JDK,这是非常容易的,你只需一路回车的安装好。然后做好以下步骤。
在 Win9x 下加入 :“PATH=%PATH%;C:jdk1.2.2in” 到AUTOEXEC.BAT文件中
在 NT 下加入 “;C:jdk1.2.2in”到环境变量中。
这一步是非常重要的,这样PHP才能正确的找到需调用的JAVA类。
第二步:修改你的PHP.INI文件。
[java]
extension=php_java.dll
java.library.path=c:webphp4extensions
java.class.path="c:webphp4extensionsjdk1.2.2php_java.jar;c:myclasses"
在PHP.INI中加入extension=php_java.dll
并在[java]中,设定好java.class.path,让它指向php_java.jar,如果你使用新的JAVA类,你也应该存入这个路径,在这篇例子中,我们使用c:myclasses这个目录。
第三步:测试环境,创建如下PHP文件:

$system = new Java("java.lang.System");
print "Java version=".$system->getProperty("java.version")."
";
print "Java vendor=".$system->getProperty("java.vendor")."
";
print "OS=".$system->getProperty("os.name")." ".
$system->getProperty("os.version")." on ".
$system->getProperty("os.arch")."
";
$formatter = new Java("java.text.SimpleDateFormat","EEEE,
MMMM dd, yyyy 'at' h:mm:ss a zzzz");
print $formatter->format(new Java("java.util.Date"))." ";
?>
如果你正确安装了,你将会看到以下信息:
Java version=1.2.2
Java vendor=Sun Microsystems Inc.
OS=Windows 95 4.10 on x86
Wednesday, October 18, 2000 at 10:22:45 AM China Standard Time
这样,我们就已经成功的建立起了可以使用JAVA类的PHP运行环境,我们可以开始我们接下去的课程了。
作者:井中月
转载:
read_exif_data
(PHP 4 )
read_exif_data -- Reads header information stored in TIFF and JPEG images
Description
array exif_read_data ( string filename, string sections, bool arrays, bool thumbnail)
Note: The read_exif_data() function is an alias for exif_read_data().
See also exif_thumbnail().
User Contributed Notes
read_exif_data
inq@inq.dhs.org
03-Jan-2001 03:52
Each of my jpeg files are over 1 meg, and read_exif_data seems to read the
whole file and it's very slow. So I wrote a function to read only the
beginning of each file:
function read_exif_data_quick($path) {
$tmpfile = "/tmp/read_exif_data_quick.tmp_file";
$in = fopen($path, "r");
$out = fopen($tmpfile,"w");
fwrite( $out, fread( $in, 15000 ) );
fclose($in);
fclose($out);
return read_exif_data($tmpfile);
}
And so far it works for all of my jpegs (taken with my digital camera).
garbage@sunflowerroad.com
06-Jul-2001 05:33
I started drooling when I saw that php could read the exif information
automatically for me. Then I found out that read_exif_data is NOT
compiled into the standard win32 build (think about including it please!).
To get around this I found the following program that runs from the
command line and works really well.
it's actually a set of utilities that will even allow you to put exif data
into images.
It's freeware, but the license says no commercial use without written
permission.
http://www.users.bigpond.com/hughthomas/exif.html
garbage@sunflowerroad.com
06-Jul-2001 05:34
By the way, it works under linux or win32
ibaldin@anr.mcnc.org
21-Aug-2001 11:43
Perl Image::Info module is capable of reading EXIF tags (places them into
an associative array). You can write a simple script to use the module and
it will extract all or only required tags out of a jpeg file.
作 者: 徐永久
我们知道 Zend 有免费的优化引擎针对 PHP 而作,但是 FreeLAMP 这次采用的是一个叫做 PHP Accelerator 的缓冲产品。
我们在 “LAMP 加速” 这篇文章中阐述过加速的几种办法,其中提到了 PHP Accelerator,它的安装方法十分简单,但是需要去他的网站获取一个激活键。
一、下载:
http://www.php-accelerator.co.uk/download.php
二、获取激活键并安装:
http://www.php-accelerator.co.uk/activate.php
注册自己的 SERVER_NAME 后,你会得到下面的提示:
Your key for www.freelamp.com is 8edfd13946c96309244fcca309415902
Now you must set the key for www.freelamp.com in your site configuration.
For single domains not using virtual hosts
The key can be set in the php.ini file as follows:
# PHPA key for www.freelamp.com
#
phpa.registration_key = 8edfd13946c96309244fcca309415902
For domains setup as a virtual host
Add the key to the domain specific section for your web server.
# www.freelamp.com VHost entry
#
ServerName www.freelamp.com
# ... (other vhost specific config)
# php settings
php_value phpa.registration_key 8edfd13946c96309244fcca309415902
# also enable phpa if set to off in the php.ini (the default is on)
php_value phpa 1
具体的 phpa 值的设置,可以参考软件随带的 CONFIGURATION 文件的配置。
由于大多数网站是虚拟主机配置,所以,建议采用 php_value phpa. 的方式设置。
例如:
php_value phpa.tweaks off
php_value phpa.cache_dir /tmp
php_value phpa.file_perms 400
php_value phpa.ignore_files "/index.php, /a/test.php"
# php_value phpa.ignore_dirs "/data/WWW/site1/,/cache/"
php_value phpa.shm_size 8
php_value phpa.shm_key 0xc0deb00
php_value phpa.shm_perms 664
三、设置 php.ini
假设我们把下载后的文件解开到 /usr/local/php ,那么在 php.ini 中加入:
zend_extension=/usr/local/php/php_accelerator_1.2p2.so
并注释掉原来的 Zend 优化引擎:
# zend_extension=/usr/local/Zend/lib/ZendOptimizer.so
最近在用PHP作一社区, 在写到计算最高上线人数时, 成功调试出把PHP作为shell script直接在服务器上运行.
在作社区时, 时常需要统计上线人数等数据. 一般做法是, 把这段代码放在用户login或者某一个页面中, 以便在用户登录或访问到该时,触发运行该代码. 这样一来, 会造成一个问题, 如果该代码教复杂, 明显减慢该页的正常调用速度.
利用PHP 的这种特性,加上linux的crontab指令,即可自动定时执行某一个php文件(统计在线人数等).
具体方法:
在安装PHP的时候,会产生一个可执行文件,文件名为php.将它它 copy 到 /usr/local/bin 下.
在终端方式执行php程序: php -q onlinnum.php<Enter>
注意到 PHP 原本是应用在网页应用的╋因此它内定会送出 HTML 的 HEADER╋但是在此我们是要将 PHP 用作 Shell Script╋"-q" 就是表示不要送出 HEADER 的意思.你可以试试看不加上 -q 的显示结果。
此时你已经可以在终端方式下执行PHP 代码了. 呵呵,可以试试执行你以前写的代码.
linux命令:cron daemon
这是一个系统中常驻的服务,功能在于执行例行性的工作,如每天一次或每月一次检查磁盘。cron daemon 会在每分钟检查一次排定的工作表(crontab),看看是否有要执行的指令,所有的输出会以mail寄给用户。
设置 crontab
命令:crontab -e<Enter>
该命令呼叫vi编辑器来编辑执行的清单。例如
            0 0 1,15 * * fsck /home
            1 * * * * /home/Gull/onlinnumber
每一行代表一项排定的工作,在指令前为排定的时间,总共有5个栏位,以空格间隔,由左到右依序如下:
       栏位        说明
        --------------------------
       分钟       从00到99
       点钟       从0到24
       日       从01到31
       月       从01到12
[!--infotagslink--]

相关文章

  • 在vbscript中判断COM类是否存在的实现代码

    在VBS中,我们有时需要判断一个COM类是否存在,以便执行不同的操作,需要的朋友可以参考下...2020-06-30
  • 如何在C#中调用COM组件

    这篇文章主要介绍了如何在C#中调用COM组件,文中讲解非常细致,代码帮助大家更好的理解和学习,感兴趣的朋友可以了解下...2020-11-03
  • python读取dicom图像示例(SimpleITK和dicom包实现)

    今天小编就为大家分享一篇python读取dicom图像示例(SimpleITK和dicom包实现),具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2020-04-27
  • PHP 和 COM

    PHP 可以操作 Win32 平台下的 COM 和 DCOM 对象 1. 我创建了一个DLL来计算一些东西. 有什么方法可以在 PHP 下运行这个DLL吗 ? 2. 'Unsupported variant type: xxxx (...2016-11-25
  • C++ COM编程之什么是接口?

    这篇文章主要介绍了C++ COM编程之什么是接口?在C++中,可以使用抽象基类来实现COM接口,需要的朋友可以参考下...2020-04-25
  • UsingCOMwithPHP(我就不翻译了)

    Using COM with PHP By John Lim. PHP4 on Windows has been extended to support Microsoft's COM technology. However documentation on the COM functions...2016-11-25
  • Python vtk读取并显示dicom文件示例

    今天小编就为大家分享一篇Python vtk读取并显示dicom文件示例,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2020-04-27
  • Windows平台的 PHP 报错 Fatal error: Class COM not found in 的解决方法

    这篇文章主要介绍了Windows平台的 PHP 报错 Fatal error: Class COM not found in 的解决方法,需要的朋友可以参考下...2016-01-27
  • C++ COM编程之QueryInterface函数(一)

    这篇文章主要介绍了C++ COM编程之QueryInterface函数(一),QueryInterface是组件本身提供对自己查询的一个接口,需要的朋友可以参考下...2020-04-25
  • win2003禁止web等目录执行exe,bat,com的方法

    还在为网站被入侵。导致可以被人运行可执行文件而烦恼嘛? 对于一个web目录来说。 根本不需要运行可执行文件的权限。这里教大家一种方法...2016-01-27
  • 在javascript中使用com组件的简单实现方法

    下面小编就为大家带来一篇在javascript中使用com组件的简单实现方法。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧,祝大家游戏愉快哦...2016-08-24
  • MVC with PHP(二)

    MVC with PHP(一)中的bug的问题是存在,最大的问题是日志系统的问题,等完成这这个介绍后我后把全部更正的程序源码打包 出来,这里就暂时不做更改了. 先来看看在applicati...2016-11-25
  • Compilingphpwithcrypt()

    Compiling php with crypt() author: Daniel Beulshausen updated: 14.10.2000 This quick tutorial shall help you to compile php with support for the crypt()...2016-11-25
  • PHP安装扩展mcrypt以及相关依赖项深入讲解

    这篇文章主要介绍了PHP安装扩展mcrypt以及相关依赖项深入讲解,步骤讲解的很清晰,有需要的同学可以研究下...2021-03-04
  • 如何利Mcrypt扩展库进行加密和解密

    综述:Mcrypt 2.4.7是一个功能强大的加密算法扩展库,它包括有22种算法,其中就包括下面的几种算法: ????Blowfish RC2 Safer-sk64 xtea ????Cast-256 RC4 Safer-sk128 ????D...2016-11-25
  • ad-comm 通用广告详解

    ad-comm 通用广告是mip广告组件中的一种,很多人都还不知道怎么使用它,下面就让一聚教程网来告诉大家怎么使用吧。 支持布局 reponsive fixed-height fi...2016-12-21
  • 理解javascript中的with关键字

    这篇文章主要帮助大家理解javascript中的with关键字,学习with关键字的作用,感兴趣的小伙伴们可以参考一下...2016-02-18
  • Python with标签使用方法解析

    这篇文章主要介绍了Python with标签使用方法解析,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下...2020-04-27
  • php使用crypt()函数进行加密

    这篇文章主要为大家详细介绍了php使用crypt()函数进行加密,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...2017-06-11
  • C++通过COM接口操作PPT

    这篇文章主要为大家详细介绍了C++通过COM接口操作PPT的相关资料,具有一定的参考价值,感兴趣的小伙伴们可以参考一下...2020-04-25