从连接到MySQL的php调用python脚本

I am able to easily call a python script from php using system(), although there are several options. They all work fine, except they all fail. Through trial and error I have narrowed it down to it failing on

import MySQLdb

I am not too familiar with php, but I am using it in a pinch. I understand while there could be reasons why such a restriction would be in place, but this will be on a local server, used in house, and the information in the mysql db is backed up and not to critical. Meaning such a restriction can be reasonably ignored.

But how to allow php to call a python script that imports mysql? I am on a Linux machine (centOs) if that is relevant.

查看全部
dplsnw7329
dplsnw7329
2013/04/29 14:55
  • python
  • linux
  • php
  • mysql
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复