Resolvido adicionando o "noserverino" aos parâmetros de montagem
Eu tenho uma VM centos 6 rodando como convidado dentro do Virtualbox. Eu configurei uma pilha LAMP que eu posso acessar a partir do ambiente host (Windows).
Eu montei um compartilhamento SMB usando 'mount -t cifs' e sou capaz de usar o apache para exibir arquivos desse compartilhamento (tudo bem até agora)
problema Agora estou tentando executar um simples script test.php na linha de comando Esta é a saída que recebo (abaixo)
observe o que acontece se eu não escrever corretamente o nome do arquivo (mensagem diferente), então o arquivo está lá, é como se o php fosse incapaz de executá-lo.
Eu incluí isso como uma imagem porque não consigo encontrar uma maneira de copiar do meu terminal VM. Qualquer ajuda apreciada, eu já passei muito mais tempo do que imaginava conseguindo isso.
edit3: Eu sou capaz de executar o php a partir da linha de comando quando não estou tentando executar um arquivo do compartilhamento samba, então ele tem algo a ver com a montagem. Eu montei a unidade assim ...
mount -t cifs -o username=xxxx,password=xxxx,nounix,fir_mode=0777,file_mode=0777,gid=48,uid=48 //path/to/samba/share /var/www/vhosts
edit1:-bash:testehexdump.php00000006574747366206c690a65000000a
edit2:
strace-omystraceoutput.txt-f-etrace=arquivophptest.php
4423execve("/usr/bin/php", ["php", "test.php"], [/* 19 vars */]) = 0
4423 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
4423 open("/etc/ld.so.cache", O_RDONLY) = 3
4423 open("/lib/libcrypt.so.1", O_RDONLY) = 3
4423 open("/usr/lib/libedit.so.0", O_RDONLY) = 3
4423 open("/lib/libncurses.so.5", O_RDONLY) = 3
4423 open("/usr/lib/sse2/libgmp.so.3", O_RDONLY) = 3
4423 open("/lib/libbz2.so.1", O_RDONLY) = 3
4423 open("/lib/libz.so.1", O_RDONLY) = 3
4423 open("/lib/libpcre.so.0", O_RDONLY) = 3
4423 open("/lib/libm.so.6", O_RDONLY) = 3
4423 open("/lib/libdl.so.2", O_RDONLY) = 3
4423 open("/lib/libnsl.so.1", O_RDONLY) = 3
4423 open("/usr/lib/libxml2.so.2", O_RDONLY) = 3
4423 open("/lib/libgssapi_krb5.so.2", O_RDONLY) = 3
4423 open("/lib/libkrb5.so.3", O_RDONLY) = 3
4423 open("/lib/libk5crypto.so.3", O_RDONLY) = 3
4423 open("/lib/libcom_err.so.2", O_RDONLY) = 3
4423 open("/usr/lib/libssl.so.10", O_RDONLY) = 3
4423 open("/usr/lib/libcrypto.so.10", O_RDONLY) = 3
4423 open("/lib/libc.so.6", O_RDONLY) = 3
4423 open("/lib/libresolv.so.2", O_RDONLY) = 3
4423 open("/lib/libfreebl3.so", O_RDONLY) = 3
4423 open("/lib/libtinfo.so.5", O_RDONLY) = 3
4423 open("/lib/libkrb5support.so.0", O_RDONLY) = 3
4423 open("/lib/libkeyutils.so.1", O_RDONLY) = 3
4423 open("/lib/libpthread.so.0", O_RDONLY) = 3
4423 open("/lib/libselinux.so.1", O_RDONLY) = 3
4423 statfs64("/selinux", 84, {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=2711275, f_bfree=2380713, f_bavail=2242985, f_files=689520, f_ffree=642048, f_fsid={-1727257207, 1632688387}, f_namelen=255, f_frsize=4096}) = 0
4423 open("/proc/filesystems", O_RDONLY|O_LARGEFILE) = 3
4423 getcwd("/var/www/vhosts/vhosts/user/mysite.co.uk/web", 4096) = 45
4423 open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
4423 open("/etc/localtime", O_RDONLY) = 3
4423 lstat64("/usr/local/sbin/php", 0xbfe43dec) = -1 ENOENT (No such file or directory)
4423 lstat64("/usr/local/bin/php", 0xbfe43dec) = -1 ENOENT (No such file or directory)
4423 lstat64("/sbin/php", 0xbfe43dec) = -1 ENOENT (No such file or directory)
4423 lstat64("/bin/php", 0xbfe43dec) = -1 ENOENT (No such file or directory)
4423 lstat64("/usr/sbin/php", 0xbfe43dec) = -1 ENOENT (No such file or directory)
4423 lstat64("/usr/bin/php", {st_mode=S_IFREG|0755, st_size=3281860, ...}) = 0
4423 lstat64("/usr/bin", {st_mode=S_IFDIR|0555, st_size=20480, ...}) = 0
4423 lstat64("/usr", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
4423 access("/usr/bin/php", X_OK) = 0
4423 open("/usr/bin/php-cli.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
4423 open("/etc/php-cli.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
4423 open("/usr/bin/php.ini", O_RDONLY) = -1 ENOENT (No such file or directory)
4423 open("/etc/php.ini", O_RDONLY) = 3
4423 lstat64("/etc/php.ini", {st_mode=S_IFREG|0644, st_size=69109, ...}) = 0
4423 lstat64("/etc", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
4423 open("/etc/php.d", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
4423 stat64("/etc/php.d/curl.ini", {st_mode=S_IFREG|0644, st_size=49, ...}) = 0
4423 open("/etc/php.d/curl.ini", O_RDONLY) = 3
4423 stat64("/etc/php.d/fileinfo.ini", {st_mode=S_IFREG|0644, st_size=57, ...}) = 0
4423 open("/etc/php.d/fileinfo.ini", O_RDONLY) = 3
4423 stat64("/etc/php.d/json.ini", {st_mode=S_IFREG|0644, st_size=49, ...}) = 0
4423 open("/etc/php.d/json.ini", O_RDONLY) = 3
4423 stat64("/etc/php.d/phar.ini", {st_mode=S_IFREG|0644, st_size=49, ...}) = 0
4423 open("/etc/php.d/phar.ini", O_RDONLY) = 3
4423 stat64("/etc/php.d/zip.ini", {st_mode=S_IFREG|0644, st_size=47, ...}) = 0
4423 open("/etc/php.d/zip.ini", O_RDONLY) = 3
4423 open("/usr/lib/php/modules/curl.so", O_RDONLY) = 3
4423 open("/etc/ld.so.cache", O_RDONLY) = 3
4423 open("/usr/lib/libcurl.so.4", O_RDONLY) = 3
4423 open("/lib/libidn.so.11", O_RDONLY) = 3
4423 open("/usr/lib/libldap-2.4.so.2", O_RDONLY) = 3
4423 open("/lib/librt.so.1", O_RDONLY) = 3
4423 open("/usr/lib/libssl3.so", O_RDONLY) = 3
4423 open("/usr/lib/libsmime3.so", O_RDONLY) = 3
4423 open("/usr/lib/libnss3.so", O_RDONLY) = 3
4423 open("/usr/lib/libnssutil3.so", O_RDONLY) = 3
4423 open("/lib/libplds4.so", O_RDONLY) = 3
4423 open("/lib/libplc4.so", O_RDONLY) = 3
4423 open("/lib/libnspr4.so", O_RDONLY) = 3
4423 open("/usr/lib/libssh2.so.1", O_RDONLY) = 3
4423 open("/usr/lib/liblber-2.4.so.2", O_RDONLY) = 3
4423 open("/usr/lib/libsasl2.so.2", O_RDONLY) = 3
4423 open("/usr/lib/php/modules/fileinfo.so", O_RDONLY) = 3
4423 open("/usr/lib/php/modules/json.so", O_RDONLY) = 3
4423 open("/usr/lib/php/modules/phar.so", O_RDONLY) = 3
4423 open("/usr/lib/php/modules/zip.so", O_RDONLY) = 3
4423 open("/proc/sys/crypto/fips_enabled", O_RDONLY) = 3
4423 stat64("/root/.terminfo", 0xbfe454b0) = -1 ENOENT (No such file or directory)
4423 stat64("/etc/terminfo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
4423 access("/etc/terminfo/l/linux", R_OK) = -1 ENOENT (No such file or directory)
4423 stat64("/usr/share/terminfo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
4423 access("/usr/share/terminfo/l/linux", R_OK) = 0
4423 open("/usr/share/terminfo/l/linux", O_RDONLY|O_LARGEFILE) = 3
4423 open("/root/.editrc", O_RDONLY) = -1 ENOENT (No such file or directory)
4423 open("/etc/nsswitch.conf", O_RDONLY) = 3
4423 open("/etc/ld.so.cache", O_RDONLY) = 3
4423 open("/lib/libnss_files.so.2", O_RDONLY) = 3
4423 open("/etc/protocols", O_RDONLY|O_CLOEXEC) = 3
4423 open("/etc/protocols", O_RDONLY|O_CLOEXEC) = 3
4423 open("test.php", O_RDONLY) = 3
4423 getcwd("/var/www/vhosts/vhosts/user/mysite.co.uk/web", 4096) = 45
4423 lstat64("/var/www/vhosts/vhosts/user/mysite.co.uk/web/test.php", {st_mode=S_IFREG|0777, st_size=10, ...}) = 0
4423 lstat64("/var/www/vhosts/vhosts/user/mysite.co.uk/web", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
4423 lstat64("/var/www/vhosts/vhosts/user/mysite.co.uk", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
4423 lstat64("/var/www/vhosts/vhosts/user", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
4423 lstat64("/var/www/vhosts/vhosts", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
4423 lstat64("/var/www/vhosts", {st_mode=S_IFDIR|0777, st_size=0, ...}) = 0
4423 lstat64("/var/www", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
4423 lstat64("/var", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
Em seguida, a execução é interrompida pelo mesmo erro de antes (erro fatal do PHP: etc ....)
Resolvido adicionando o "noserverino" aos parâmetros de montagem
Você tem certeza que o test.php inclui test.php? Isso pode causar resultados desagradáveis.
Se você pode rodar o mesmo arquivo PHP a partir da CLI quando copiado para um diretório local, então eu acho que pode ser um problema de segurança do SELinux.
Tente procurar em mensagens por notificações do SELinux ou simplesmente desativá-las temporariamente. Nós tivemos muitos problemas (até que descobrimos) mesmo em um sistema de arquivos local com arquivos que o SELinux estava bloqueando o acesso.