存档在 2012年7月

使用短标签导致PHP程序不执行直接输出源码

2012年7月9日

今天调试一个PHP程序,突然发现某个PHP文件不执行,而是输出源码,后来检查发现,是短标签的问题。因为在PHP.INI文件中已经默认把短标签只识别支持默认关闭掉了。要解决问题,只需要打开即可,或者直接把<? 改成 <?php。

问题现象:

<?php echo “123”; ?>可以执行

<? echo “123”; ?>却直接输出源码。

解决办法:

在PHP.INI文件中,查找<?或short_open_tag,有下面信息提示,意思是是否打开短标签识别,而且已经推荐大家使用完整封堵标签<?php and ?>,尽量不要使用短标签<? and ?>。 » 阅读更多: 使用短标签导致PHP程序不执行直接输出源码

phpMyAdmin“缺少 mcrypt 扩展。请检查 PHP 配置。”解决办法

2012年7月9日

在安装配置phpMyAdmin管理mysql数据库的时候,打开phpMyAdmin登录页面,出现下面的错误提示:

缺少 mcrypt 扩展。请检查 PHP 配置

解决办法是:安装php-mcrypt libmcrypt libmcrypt-devel这三个库文件。步骤如下:

1、安装第三方yum源(默认yum源里面没有这几个库文件,不能使用yum直接安装)

# wget http://www.atomicorp.com/installers/atomic #下载

# sh ./atomic #安装

2、使用yum命令安装

# yum install php-mcrypt libmcrypt libmcrypt-devel

3、重启Apache

# service httpd restart

The Epic of Gilgamesh

2012年7月6日

来源:http://stutzfamily.com/mrstutz/mesopotamia/gilgamesh
参考:https://en.wikipedia.org/wiki/Epic_of_Gilgamesh

Gilgamesh was an historical king of Uruk in Babylonia, on the River Euphrates in modern Iraq; he lived about 2700 B.C. Although historians tend to emphasize Hammurabi and his code of law, the civilizations of the Tigris-Euphrates area focus on Gilgamesh and the legends accruing around him to explain, as it were, themselves. Many stories and myths were written about Gilgamesh, some of which were written down about 2000 B.C. in the Sumerian language on clay tablets which still survive. All the above languages were written in the script known as cuneiform, which means “wedge-shaped.” The fullest surviving version, from which the summary here is taken, is derived from twelve stone tablets, in the Akkadian language, found in the ruins of the library of Ashurbanipal, king of Assyria 669-633 B.C., at Nineveh. The library was destroyed by the Persians in 612 B.C., and all the tablets are damaged. The tablets actually name an author, which is extremely rare in the ancient world, for this particular version of the story: Shin-eqi-unninni. You are being introduced here to the oldest known human author we can name by name!

Tablet 1

The one who saw all I will declare to the world,
The one who knew all I will tell about
He saw the great Mystery, he knew the Hidden:
He recovered the knowledge of all the times before the Flood.
He journeyed beyond the distant, he journeyed beyond exhaustion,
And then carved his story on stone.

This great hero who had all knowledge, Gilgamesh, built the great city of Uruk; the tablet invites us to look around and view the greatness of this city, its high walls, its masonwork, and here at the base of its gates, as the foundation of the city walls, a stone of lapis lazuli on which is carved Gilgamesh’s account of his exploits, the story you are about to hear. The account begins: Gilgamesh, two-thirds god and one-third human, is the greatest king on earth and the strongest super-human that ever existed; however, he is young and oppresses his people harshly. The people call out to the sky-god Anu, the chief god of the city, to help them. In response, Anu creates a wild man, Enkidu, out in the harsh and wild forests surrounding Gilgamesh’s lands. This brute, Enkidu, has the strength of dozens of wild animals; he is to serve as the subhuman rival to the superhuman Gilgamesh.

A trapper’s son, while checking on traps in the forest, discovers Enkidu running naked with the wild animals; he rushes to his father with the news. The father advises him to go into the city and take one of the temple harlots, Shamhat, with him to the forest; when she sees Enkidu, she is to offer herself to the wild man. If he submits to her, the trapper says, he will lose his strength and his wildness.

Shamhat meets Enkidu at the watering-hole where all the wild animals gather; she offers herself to him and he submits, instantly losing his strength and wildness, but he gains understanding and knowledge. He laments for his lost state, but the harlot offers to take him into the city where all the joys of civilization shine in their resplendence; she offers to show him Gilgamesh, the only man worthy of Enkidu’s friendship.

Tablet 2

Enkidu is gradually introduced to civilization by living for a time with a group of shepherds, who teach him how to tend flocks, how to eat, how to speak properly, and how to wear clothes. Enkidu then enters the city of Uruk during a great celebration. They fight furiously until Gilgamesh wins the upper hand; Enkidu concedes Gilgamesh’s superiority and the two embrace and become devoted friends. Both Enkidu and Gilgamesh gradually weaken and grow lazy living in the city, so Gilgamesh proposes a great adventure: they are to journey to the great Cedar Forest in southern Iran and cut down all the cedar trees. To do this, they will need to kill the Guardian of the Cedar Forest, the great demon, Humbaba the Terrible. Enkidu knows about Humbaba from his days running wild in the forest; he tries in vain to convince Gilgamesh not to undertake this folly.

Tablet 3

[Most of tablet three doesn’t exist]

Tablet 4

Tablet four tells the story of the journey to the cedar forest.

Tablet 5

Gilgamesh and Enkidu kill Humbaba and cut down the cedar forest – they want to use the tallest of the cedar trees to make a great gate for the city of Uruk. They build a raft out of the cedar and float down the Euphrates river to their city.

Tablet 6

After these events, Gilgamesh, his fame widespread and his frame resplendent in his wealthy clothes, attracts the attention of the goddess Ishtar, who comes to Gilgamesh and offers to become his lover. Gilgamesh refuses with insults, listing all the mortal lovers that Ishtar has had and recounting the dire fates they all met with at her hands. Deeply insulted, Ishtar returns to heaven and begs her father, the sky-god Anu, to let her have the Bull of Heaven to wreak vengeance on Gilgamesh and his city:

Father, let me have the Bull of Heaven
To kill Gilgamesh and his city.
For if you do not grant me the Bull of Heaven,
I will pull down the Gates of Hell itself,
Crush the doorposts and flatten the door,
And I will let the dead leave
And let the dead roam the earth
And they shall eat the living.
The dead will overwhelm all the living!

Anu reluctantly gives in, and the Bull of Heaven is sent down into Uruk. Each time the bull breathes, its breath is so powerful that enormous abysses are opened up in the earth and hundreds of people fall through to their deaths. Working together again, Gilgamesh and Enkidu slay the mighty bull. Ishtar is enraged, but Enkidu begins to insult her, saying that she is next, that he and Gilgamesh will kill her next, and he rips one of the thighs off the bull and hurls it into her face.

Tablet 7

Enkidu falls ill after having a set of ominous dreams; he finds out from the priests that he has been singled out for revenge by the gods. The Chief Gods have met and have decided that someone should be punished for the killing of Humbaba, the killing of the Bull of Heaven, and the insult to Ishtar. Of the two heroes, they decide Enkidu should pay the penalty. Enraged at the injustice of the decision, Enkidu curses the great Cedar Gate built from the wood of the Cedar Forest, and he curses the temple harlot, Shamhat, and the trapper, for introducing him to civilization. After suffering terribly for twelve days, Enkidu finally dies.

Tablet 8

Gilgamesh is torn apart by the death of his friend, and utters a long lament, ordering all of creation to never fall silent in mourning his dead friend. Most of this tablet is missing, but the second half seems to be a description of the monument he builds for Enkidu.

Tablet 9

Gilgamesh allows his life to fall apart; he does not bathe, does not shave, does not take care of himself, not so much out of grief for his friend, but because he now realizes that he too must die and the thought sends him into a panic. He decides that he can’t live unless granted eternal life; he decides to undertake the most perilous journey of all: the journey to Utnapishtim and his wife, the only mortals on whom the gods had granted eternal life. Utnapishtim is the Far-Away, living at the mouth of all rivers, at the ends of the world.

Tablet 10

After a long and dangerous journey, Gilgamesh arrives at a shore and encounters another man. He tells this man that he is looking for Utnapishtim and the secret of eternal life; the old man advises Gilgamesh that death is a necessary fact because of the will of the gods; all human effort is only temporary, not permanent.

Tablet 11

At this point, Gilgamesh realizes that he is talking to Utnapishtim, the Far-Away; he hadn’t expected an immortal human to be ordinary and aged. He asks Utnapishtim how he received immortality, and Utnapishtim tells him the great secret hidden from humans: In the time before the Flood, there was a city, Shuruppak, on the banks of the Euphrates. There, the gods held a secret meeting; they all resolved to destroy the world in a great flood. All the gods were under oath not to reveal this secret to any living thing, but Ea (one of the gods that created humanity) came to Utnapishtim’s house and told the secret to the walls of the house, thus not technically violating his oath to the rest of the gods (guess who was listening while he talked!). He advised the walls to build a great boat, its length as great as its breadth, to cover the boat, and to bring all living things into the boat.

Utnapishtim gets straight to work and finishes the great boat by the new year. He then loads the boat with gold, silver, and all the living things of the earth, and launches the boat. Ea orders him into the boat and commands him to close the door behind him. The black clouds arrive, with the thunder god Adad rumbling within them; the earth splits like an earthenware pot, and all the light turns to darkness. The Flood is so great that even the gods are frightened:

The gods shook like beaten dogs, hiding in the far corners of heaven,
Ishtar screamed and wailed:

“The days of old have turned to stone:
We have decided evil things in our Assembly!
Why did we decide those evil things in our Assembly?
Why did we decide to destroy our people?
We have only just now created our beloved humans;
We now destroy them in the sea!”
All the gods wept and wailed along with her,
All the gods sat trembling, and wept.

The Flood lasts for seven days and seven nights, and finally light returns to the earth. Utnapishtim opens a window and the entire earth has been turned into a flat ocean; all humans have been turned to stone. He then falls to his knees and weeps. The boat comes to rest on the top of Mount Nimush; it lodges firmly on the mountain peak just below the surface of the ocean and remains there for seven days. On the seventh day:

I [Utnapishtim] released a dove from the boat,
It flew off, but circled around and returned,
For it could find no perch.
I then released a swallow from the boat,
It flew off, but circled around and returned,
For it could find no perch.
I then released a raven from the boat,
It flew off, and the waters had receded:
It eats, it scratches the ground, but it does not circle around and return.
I then sent out all the living things in every direction and sacrificed a sheep on that very spot.

The gods smell the odor of the sacrifice and begin to gather around Utnapishtim. Enlil, who had originally proposed to destroy all humans, then arrives, furious that one of the humans had survived, since they had agreed to wipe out all humans. He accuses Ea of treachery, but Ea convinces Enlil to be merciful. Enlil then seizes Utnapishtim and his wife and blesses them with immortality.At the end of his story, Utnapishtim offers Gilgamesh a chance at immortality. If Gilgamesh can stay awake for six days and seven nights, he, too, will become immortal. Gilgamesh accepts these conditions and sits down on the shore; the instant he sits down he falls asleep. Utnapishtim tells his wife that all men are liars, that Gilgamesh will deny having fallen asleep, so he asks his wife to bake a loaf of bread every day and lay the loaf at Gilgamesh’s feet. Gilgamesh sleeps without ever waking up for six days and seven nights, at which point Utnapishtim wakes him up. Startled, Gilgamesh says, “I only just dozed off for half a second here.” Utnapishtim points out the loaves of bread, showing their states of decay from the most recent, fresh bread, to the oldest, moldy, stale bread that had been laid at his feet on the very first day. Gilgamesh is distraught.

Utnapishtim’s wife convinces the old man to have mercy on him; he offers Gilgamesh in place of immortality a secret plant that will make Gilgamesh young again. The plant is at the bottom of the ocean surrounding the Far-Away; Gilgamesh ties stones to his feet, sinks to the bottom, and plucks the magic plant. But he doesn’t use it because he doesn’t trust it; rather he decides to take it back to Uruk and test it out on an old man first, to make sure it works. On the way, they stop to eat and sleep; while they’re sleeping, a snake slithers up and eats the magic plant (which is why snakes shed their skin) and crawls away. Gilgamesh awakens to find the plant gone; he falls to his knees and weeps:

Tablet 12

The tale ends with Gilgamesh, at the end of his journey standing before the gates of Uruk, inviting Urshanabi to look around and view the greatness of this city, its high walls, its masonwork, and here at the base of its gates, as the foundation of the city walls, a stone of lapis lazuli on which is carved Gilgamesh’s account of his exploits.

域名案例:阿里巴巴旗下五大产品域名

2012年7月4日

域名在互联网上起的作用至关重要,好域名能够助力企业更好域名,阿里巴巴集团在国内发展力影响巨大,在域名界内也扮演着重要角色,阿里巴巴alibaba.com,阿里“ali”品牌兴起,淘宝网taobao.com创立后,淘“tao”系列域名风靡一时,阿里巴巴在域名界内创造了一个个神话。

牢固的品牌“ali”域名

1999年马云创办了电子商务公司阿里巴巴,并启用四拼域名alibaba.com上线运营,尽管当时启用四拼域名令业内很多人不被看好,但阿里巴巴的成功运营是令人“刮目相看”,阿里巴巴发展壮大,并缔造了阿里“ali”系列家族,如今,业内已“ali”家庭成员宠大,阿里妈妈alimama.com/.cn/.com.cn/.net,阿里爷爷aliyeye.com/.cn,阿里哥哥aligege.com/.cn,阿里奶奶alinainai.com,阿里姐姐alijiejie.com等等,“ali”系列成阿里巴巴品牌经典之最,阿里巴巴对这类域名很看重,此前曾收购了阿里贷款全套域名alidaikuan.com/cn/com.cn。

“tao”系列域名最具商机

自2003年启用拼音域名taobao.com创立淘宝网后,淘概念域名在业内引起了轰动,“淘”相关域名纷纷被抢注,嗨淘hitao、淘沙taosha、趣淘qutao等域名成为域名爱好者珍藏对象,阿里对于这个系列域名也很保护,收购淘帮派三拼域名 taobangpai.com/.cn/.com.cn,淘资讯域名taozixun.com/.cn/.com.cn,嗨淘域名hitao.com/.cn、淘宝etao.com和yitao.com等域名,并相应推出了淘资讯、嗨淘频道、一淘网。很多电子商务平台推出选择也是“淘”域名,如康盛创想原副总裁李明顺创业低调收购聚淘域名jutao.com上线推出团购搜索,借“淘”影响,令网站更易于推广。可见,“淘”域名是国内最流行域名,最富商机域名。
» 阅读更多: 域名案例:阿里巴巴旗下五大产品域名

白话域名发展史

2012年7月4日

常常有小盆友搞不清楚是威瑞信(VeriSign)大还是ICANN大,更有童鞋在看到好域名介绍Network Solutions时说这是家不知名的小公司。所以QQPCC觉得有必要给大伙说说域名的历史了,不过QQPCC个人的习惯是不喜欢官样文章地写,喜欢白话,所以就有了这个《白话域名发展史》。

说域名历史最早应该从1984年说起,因为1984年正式引入了DNS(域名解析服务器),并开始提供大家熟悉的.net、.com、.gov等叫域名的东东。也许大家会奇怪,为什么QQPCC把.net放在前面,因为世界上第一个被注册的域名就是Nordu.net,是1985年1月被人注册的,第二个才是.com的,1985年3月15日,Symbolics.com被人注册。说句题外话,过去.net比.com“吃香”,如网易最早就是用.net域名的,.com只是保护性注册了。

域名刚刚开始的那几年,申请者寥寥无几。直到1993年,WWW这个东东出现以后,人们才感到了“域名”的重要性,域名才开始“吃香”。

1993年,Network Solutions公司与美国政府签了一个为期5年的合同,独家经营.COM、.ORG、.NET三个国际顶级域名的注册权,当时,全世界域名总数才7000个左右。

根据合同,1994年起,Network Solutions向每个域名收100美元的注册费,两年后每年收取50美元的管理费。哈哈,谁说现在域名贵,和当时相比,现在真的是太便宜了。另一方面,大家应该知道为什么现在Network Solutions注册域名都那么贵了吧,人家现在可算是降了不少了,呵呵。

到了1998年初,Network Solutions已注册域名约120多万个,其中有约90%是.COM后缀,单此一项,Network Solutions进帐6000多万美元。1999年就更是不得了,有人估计Network Solutions仅域名注册费一项就年创收2亿美元。

由于长期以来,域名的管理权限在美国政府,很多国家对此表示了强烈的不满。迫于国际压力,美国只好进行让步。从1997年7月开始,着手进行域名管理的改革,到1998年1月30日,美国的商务部通过其官方网站正式公布了改革方案的草案。草案称美国政府将“谨慎和有序”地域名管理权由美国政府移交给民间机构,计划组建一个非盈利性质的民间组织来接管域名的管理权,最迟在2000年9月30日前完成管理职能的移交。 » 阅读更多: 白话域名发展史