Hello World!之php调用COM+组件(转)
上次继本人发布了VC编写PHP扩展之Hello World篇后,反映很强烈,大家都希望能脱离PHP菜鸟行列,这次我给大家带来PHP调用C#编写的COM+组件。 COM+组件源代码 CODE:using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Reflection; using System.Data.OleDb; using System.Data; using System.Collections; using System.Collections.Specialized; namespace comtest { [Guid("DE03FB14-23D6-4be0-93EA-C27651A22A37")] public interface ITest { string Test(string test); [DispId(0)] string About(); [DispId(1)] int Add(int a, int b); } [Guid("0ED3C99A-6EBB-4df5-B03F-16CACE242C67")] public class Class1 : ITest { public string Test(string test) { return test; } public string About() { return "欢迎访问 http://www.sojqi.com"; } public int Add(int a, int b) { return a + b; } } } 以上代码编译后生成 comtest.dll 然后将其注册 php调用 [php]
add($t1,$t2); $f=$b->about(); echo $r; echo $f; ?> [/php]
相关文档:
how to install apache, PHP and MySQL on Linux
This tutorial explains the installation of Apache web server, bundled
with PHP and MySQL server on a Linux machine. The tutorial is primarily for SuSE
9.2, 9.3, 10.0 & 10.1, but most of the steps ought to be valid for all
Linux-like operating ......
一、FastCGI是什么?
FastCGI是语言无关的、可伸缩架构的CGI开放扩展,其主要行为是将CGI解释器进程保持在内存中并因此获得较高的性能。众所周知,CGI解释 器的反复加载是CGI性能低下的主要原因,如果CGI解释器保持在内存中并接受FastCGI进程管理器调度,则可以提供良好的性能、伸缩性、Fail- Over特性等等。
FastCGI的官 ......
要不出现乱码,就要保持数据库和页面的编码格式一致.我全部使用utf-8的编码.
首先页面:
1. 将文件用UE打开,将文件另存为UTF-8无BOM格式.很多编辑器都可用.
2.使用 header("content-type:text/html; charset=utf-8"); 强制转换成utf-8的编码.
也可以新建一个head.php,如下,在页面中用include( ......
EClipse for PHP 中文乱码问题
UTF-8 格式的php,中文都是乱码.
如果此时在EClipse中输入中文会有 CP1252 错误( CP1252不支持xxxx )
解决方法:
windows->preferences->general 打开点击workspace 此时右侧出现text file encoding就是文本编码 default cp1252 点击other 下拉菜单 选择UTF-8 选择即可编译 ......
代码如下:
<?php
/* 网站验证码程序
* 运行环境: PHP5.0.18 下调试通过
* 需要 gd2 图形库支持(PHP.INI中 php_gd2.dll开启)
*&nbs ......