저는 PHP 서비스를 만들고, Vertrigo에서 로컬로 작업 한 다음 IBM Bluemix에 업로드하는 프로젝트를 진행하고 있습니다.bluemix에서 PHP 코드 작동을 시도했습니다.
코드는 로컬에서 잘 작동하는 것처럼 보이지만 Bluemix에서 코드를 찾아 내려고 시도 할 때 오류가 발생합니다.
프로젝트는 index.html
, client.php
및 server.php
의 세 파일로 구성됩니다. 문제는 client.php
과 server.php
사이에 있습니다. server.php
에 정의 된 함수를 client.php
에서 호출하려고하면 해당 함수를 호출 한 행을 건너 뛰고 나머지는 계속 실행합니다.
이것은 client.php 코드의 일부이다
<?php
if(isset($_POST['saludo']) && !empty($_POST['nombre']) && !empty($_POST['apellido'])) {
require_once ('nusoap.php');
$soapclient = new soapclient('server.php');
$resultado = $soapclient->call('funcionsaludo',array('nombre'=>$_POST['nombre'],'apellido'=>$_POST['apellido']));
$html = <<<html
<html>
<head></head>
<title>Saludando...</title>
<body bgcolor = "#9d1fc4" text = "black"><center><img src = "/images/3.jpg"></center><br><br>
<center><b>$resultado<br><br><a href='index.html' style='color: #ffffff'>INICIO</a></b></center>
</body>
</html>
html;
echo $html;
}
스킵되는 부분은 어디 이루어진다 파일 server.php
호출 : 마지막
$soapclient = new soapclient('server.php');
$resultado = $soapclient->call('funcionsaludo',array('nombre'=>$_POST['nombre'],'apellido'=>$_POST['apellido']));
, server.php 파일의 일부를 보여줍니다.
<?php
require_once('nusoap.php');
$server = new soap_server;
$server->register('funcionsaludo');
$server->register('getData');
$server->register('insertData');
function funcionsaludo ($nombre,$apellido) {
return "<html><head></head><body>Hola $nombre $apellido<br><br></body></html>";
}
결과적으로 다음과 같은 기능이 있습니다. funcionsaludo
은 "Hola $ nombre $ apellido"로 구성된 문자열을 반환하지만 문자열이 화면에 표시되지 않기 때문에 건너 뛴 것처럼 보입니다.
나는 또한 추가 할 모든 3 개 개의 파일 index.html
, client.php
, server.php
모든 IBM Bluemix 개발 운영 서비스 내부의 기본 프로젝트 폴더에 업로드 된 nusoap.php
이다 사용되는 라이브러리 및 서로 다른 폴더에 아니에요 또는 그런 것. 또한 로그에 일부 표시등이 표시 될 수있는 오류 메시지가 표시되지 않습니다.
server.php
파일의 해당 기능을 건너 뛰는 이유에 대해 도움을 주신 데 대해 감사드립니다. 고맙습니다 !
죄송합니다. 게시 한대로 작은 따옴표를 사용하면 변수를 연결해야합니다. 연결하지 않으려면 큰 따옴표를 사용해야하지만 HTML 태그의 태그를 이스케이프 처리해야합니다. –