这几天在研究设置cornjob
但是设置这个需要知道php的安装路径
网上一般都是说 /usr/local/bin/php 后面跟上php的绝对路径,但是我试了一下不能用。
看phpinfo试了几个地址都不能用
所以请问一下如何看到服务器上php的安装路径。
回复讨论(解决方案)
把你的phpinfo的Configure Command项的内容贴出来。
或者locate phpize看看它位于哪个目录,php的bin文件应该是跟它一个目录的。如果什么信息也没有。就find / -name "phpize"吧
如果编译时不指定prefix,则会默认安装到/usr/local/php/下面。
'./configure' '--prefix=/usr/local/php5' '--enable-force-cgi-redirect' '--enable-fastcgi' '--with-config-file-path=/usr/local/etc/php5/cgi' '--with-curl=/usr/local/lib' '--with-gd' '--with-gettext' '--with-jpeg-dir=/usr/local/lib' '--with-freetype-dir=/usr/local/lib' '--with-kerberos' '--with-openssl' '--with-mcrypt' '--with-mhash' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config' '--with-pcre-regex=/usr/local' '--with-pdo-mysql=/usr' '--with-pear' '--with-png-dir=/usr/local/lib' '--with-zlib' '--with-zlib-dir=/usr/local/lib' '--enable-zip' '--enable-gd-native-ttf' '--with-iconv=/usr/local' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-mbstring'
phpinfo是这样的
我是虚拟主机所以没有办法在上面执行服务器命令,只有DirectAdmin管理面板
/usr/local/php5
安装目录肯定是这个,bin文件是/usr/local/etc/php5/bin/php。如果你无法访问,那可能是权限的问题。虚拟主机的管理员应该不会让你碰这个目录,否则你改出问题了,全服务器的所有网站都要遭殃。
php.ini在/usr/local/etc/php5/cgi这个目录
我不知道是不是我设置方法不对
在DirectAdmin管理的cornjob里面设置成
* * * * * /usr/local/etc/php5/bin/php 后面加上php的绝对路径这样
是不是就是每分钟执行一次后面那段语句了。
我设置了一下没反应。
cornjob每个参数都是*号应该就是每分钟一次吧……
*/1 * * * * /usr/local/etc/php5/bin/php >> /home/xx/cronlog
这样是每分钟执行一次。如果你想检查是否按你的想法执行了。后面可以加个日至记录一下,然后过几分钟去看看打印了几次log。
我用这个命令跑了一下,有cornlog这个文件生成,但是等了很久都是一个空文件没有任何记录 这是算什么情况……
我用这个跑php文件在一个mysql数据库中写数据也是完全没有结果……
ls下你们php下面的路径文件看看,
最简单的方法是检测进程。
ps -ef |grep php
下面列出的路径基本就是.
whereis php
最简单的方法是检测进程。
ps -ef |grep php
下面列出的路径基本就是.
hahascho 833 30068 1 01:42 ? 00:00:00 /usr/local/php5/bin/php-cgi
zoefiona 913 30613 1 01:43 ? 00:00:00 [php-cgi]
ggbootbl 990 32677 62 01:43 ? 00:00:30 [php-cgi]
ggbootbl 1159 974 64 01:43 ? 00:00:21 /usr/local/php5/bin/php-cgi
zoefiona 1323 865 11 01:43 ? 00:00:01 /usr/local/php5/bin/php-cgi
cawennet 1384 969 1 01:43 ? 00:00:00 /usr/local/php5/bin/php-cgi
ictgu 1419 668 2 01:43 ? 00:00:00 [php-cgi]
haoguior 1423 1417 11 01:43 ? 00:00:00 [php-cgi]
gckzeduc 1458 1428 9 01:43 ? 00:00:00 [php-cgi]
ictgu 1484 973 0 01:44 ? 00:00:00 /usr/local/php5/bin/php-cgi
ictgu 1485 32688 0 01:44 ? 00:00:00 /usr/local/php5/bin/php-cgi
感谢,我在corn上用这个命令导出了一下出上面的结果 可以判定bin文件应该是/usr/local/php5/bin/php-cgi了
但是我用这个命令加上php路径在corn里面跑依然不成功。
用 whereis php 没错的

Long URLs, often cluttered with keywords and tracking parameters, can deter visitors. A URL shortening script offers a solution, creating concise links ideal for social media and other platforms. These scripts are valuable for individual websites a

Following its high-profile acquisition by Facebook in 2012, Instagram adopted two sets of APIs for third-party use. These are the Instagram Graph API and the Instagram Basic Display API.As a developer building an app that requires information from a

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

This is the second and final part of the series on building a React application with a Laravel back-end. In the first part of the series, we created a RESTful API using Laravel for a basic product-listing application. In this tutorial, we will be dev

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

The 2025 PHP Landscape Survey investigates current PHP development trends. It explores framework usage, deployment methods, and challenges, aiming to provide insights for developers and businesses. The survey anticipates growth in modern PHP versio


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SublimeText3 Linux new version
SublimeText3 Linux latest version

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!
