PHP - Moved: Best Xdebug Client For Mac Osx
This topic has been moved to Miscellaneous.
http://www.phpfreaks.com/forums/index.php?topic=354998.0 Similar TutorialsThis topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=353630.0 Hi i am trying to use xdebug 2.1.0, i have installed it on linux wth php version 5.2.5, Can any one tell me the correct php version for 2.1.0 this . What is this phpize and php-config tools.....where to find and how........tell some examples to use xdebug. Thanks, This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=319056.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=317142.0 Hi y'all. I've been scrubbing Google for this and from everything I'm reading and seeing, this should be working - problem is it's not... Here's the deal. I've got a docker image spun up with my development environment and all that's fine. I've updated the php.ini on the image with the following: [xdebug] xdebug.remote_autostart=1 xdebug.remote_enable=1 xdebug.remote_log="/var/log/xdebug.log" xdebug.remote_host=host.docker.internal xdebug.remote_handler=dbgp xdebug.remote_port=9000 xdebug.remote_connect_back=0 xdebug.collect_vars=1 xdebug.collect_returns=1 xdebug.collect_assignments=1 xdebug.profiler_enable=1 xdebug.idekey=VSCODE I created a new config in launch.json as so: { "name": "Remote XDebug", "type": "php", "request": "launch", "port": 9900, "pathMappings": { "/var/www/html" : "${workspaceRoot}/myDir" }, "cwd": "${workspaceRoot}/myDir" } I set a few breakpoints in VSCode in my file on the host system, start the debugger, and docker-compose run into the image, where I `php test.php` and expect to be brought into the debug session as I would on the host system (that part works). However, it doesn't happen - I never get into the debug session on the host system. My xdebug.log does, however, look like everything should be working: [11] Log opened at 2020-05-04 20:37:03 [11] I: Connecting to configured address/port: host.docker.internal:9000. [11] I: Connected to client. :-) [11] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///var/www/html/testing/test.php" language="PHP" xdebug:language_version="7.1.33" protocol_version="1.0" appid="11" idekey="VSCODE"><engine version="2.9.1"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2020 by Derick Rethans]]></copyright></init> [11] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response> [11] Log closed at 2020-05-04 20:37:03 Oh, and my docker-compose file maps port 9900 on the host to 9000 image. service: build: context: '.' volumes: - ../myDir/:/var/www/html/ - ../logs/:/var/log/ ports: - 80:80 - 443:443 - 9900:9000 networks: - test environment: - ENVIRONMENT=development depends_on: - database Anybody have any ideas? I'm just burning time on this now, but I'd very much like to be able to debug in the docker container because I'm currently working with a couple different companies that use wildly different php/server setups and I don't want to have to try and keep that straight or have to continually nuke my machine. Thanks in advance! Edited May 4, 2020 by maxxdThis topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=347977.0 This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=318011.0 I wish to create validation rules once which are used both on the client and on the server.
For instance, I will start off with the following PHP object:
stdClass Object ( [rules] => stdClass Object ( [email] => stdClass Object ( [required] => 1 [email] => 1 [remote] => stdClass Object ( [url] => check-email.php [type] => post [data] => stdClass Object ( [username] => function() {return $( '#username' ).val();} ) ) ) ) [messages] => stdClass Object ( [email] => stdClass Object ( [required] => an email is required ) ) )When the edit page is downloaded to the client, I will include this object in some format suitable to the client. The client will then use the jQuery Validation plugin (http://jqueryvalidation.org/) along with the validation object, and client side validate the page. When the form passes client side validation and is uploaded, PHP will use the same validation object to serverside validate the form (I have this part working as desired). My question is how should I pass this data to the client? Originally, I would just use PHP to write some JavaScript. exit('var myObj='.json_encode($myObj));Note that when I json_encode the object, the value of $myObj->rules->email->remote->data->username is a string with quotes around it, however, I can easily use PHP to strip these tags before sending it to the client. As Jacques1 pointed out in http://forums.phpfre...ascript-client/, I should never ever use PHP to generate JavaScript, and should use AJAX to download the JSON directly. I tried doing the later, but found that a callback function could not be included in the JSON. Please advise on the best way to accomplish this. Thank you Dear all, I'm working on a website that is hosted on a server with 10Mb of file size limit via HTTP file uploading approach (eg. PHP file uploading form using move_uploaded_file()), although there's no file size limit via FTP file uploading approach (eg. Using FTP client). Therefore, I was thinking about using PHP FTP functions to bypass the file size limit. However, when I upload file bigger than 10Mb, I still got this error message telling me that my file can't be over 10Mb... So my question is...what exactly are the differences between PHP FTP and FTP Client, that the web server used to determine whether to block the file bigger than 10Mb or not? Thank you very much! Below is my code: Code: [Select] <?php echo '<form action="" method="post" enctype="multipart/form-data">'; echo 'Click the Browse button to find the file you wish to upload'; echo '<input type="file" name="add_file">'; echo '<INPUT TYPE="submit" name="upload" value="upload">'; echo '</form>'; if($_POST['upload']) { $add_file = $_FILES['add_file']; //change these values to suit your site $ftp_user_name = 'username'; $ftp_user_pass = 'password'; $ftp_server = 'ftp.domainname.com'; $ftp_root = '/'; //File upload $temp_path = $ftp_root . $add_file['tmp_name']; $target_path = basename($add_file['name']); $max_size = 26214400; if($add_file['error'] == 0 && $add_file['size'] < $max_size) { // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // upload a file ftp_chdir($conn_id, '/root/second/'); if (ftp_put($conn_id, $target_path, $temp_path, FTP_ASCII)) { echo "successfully uploaded " . $target_path; } else { echo "There was a problem while uploading " . $target_path; } } else { echo "There's been an error, please try again later."; } // close the connection ftp_close($conn_id); } ?> Hi, guys. I just developed and published first version of 12framework for iOS which can call also PHP web services.
It is web service client which generates dynamic forms from web service results, and enables insert, update and delete of records. You can simply change result field type to text, memo, date, bool.
I also made some simple PHP web service to test functionallity of application, so I will really appreciate your feedback. iOS is locked platform, so 12framework provides possibility, to make some useful data forms that works as native application. Link: https://itunes.apple...88083?ls=1&mt=8
I have two questions, I was wondering what would be the best method to go about building client side API functions on top of a already built API eg. http://docs.whmcs.com/API:Functions
We would like to provide our clients access to API functions related to their accounts without giving them access to the whole Admin API where they can see a lot of our other client information.
The other question we have an API built using Basic HTTP Auth for API authenication (HTTPS). eg curl username:password http://api.etc.com) If so what would be the best way to secure this method?
Thank you I feel like I was 75% there, and now I'm only 25% there. I'm trying to put my links onto my page. http://thingsihateaboutyou.net/michelle is my testing page. So I have register (register.php), login (login.php), logout (logout.php), and the members area. The members area is going to be their username.php, so I assumed this would be $username.php like I have it in the redirect link from the point where you login to the point where you see your client page. This works fine. The part I'm having trouble with is the visibility of the links on my page to these, AND adding a PHP variable ($username) into the "members area" tag. When you click on members area, it should send you to http://thingsihateaboutyou.net/michelle/*whatever you are logged in as*.php As for the visibility, if you are not logged in I obviously don't want you to see a link called "log out" or a link called "members area," and vise versa. It's been like 5 hours now, and I keep getting further and further away. I had to bail on my Wordpress so I don't have a Content Management System in place. All of this DID work and it worked excellent, but after I made the switch earlier today it kind of blew up in my face. I am attaching a ZIP file with everything included... in desperate need of an answer. Hi everyone, I've been trying to find a decent SOAP client library for PHP. The problem with PHPs own SoapClient is that it's very basic and doesn't really have support for different namespaces and headers with namespaces. It doesn't have the option to make custom attributes on soap headers or params. It can't make nested headers with SoapVars or Params and so on. Same goes to Zends SoapClient which is basicly just a wrapper for PHPs SoapClient. Is there any good client library that could handle all this stuff? I'm trying to access webservices using PHP's soap. Here's my code: <?php // test connection to agwebservice $agLogURL = "https://www.agemni.com/_snet/AgemniLogin.asmx?WSDL"; $agDN = "myDN"; $agUserName = "myUserName"; $agPass = "myPassword"; $login = new SoapClient($agLogURL); $login->aglogin($agDN, $agUserName, $agPass); // $login.service.agLogin($agDN, $agUserName, $agPass); ?> When I run the script, here's the resulting error: Fatal error: Uncaught SoapFault exception: [soap:Server] System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException: Object reference not set to an instance of an object. at AgemniLogin.agLogin(String dn, String username, String password) --- End of inner exception stack trace --- in C:\XAMPP\xampp\htdocs\agsync\syncwork.php:12 Stack trace: #0 [internal function]: SoapClient->__call('aglogin', Array) #1 C:\XAMPP\xampp\htdocs\agsync\syncwork.php(12): SoapClient->aglogin('myDN', 'myUserName', 'myPassword') #2 {main} thrown in \htdocs\agsync\syncwork.php on line 12 Not sure if you'll need more info on the SOAP services, but the info is he http://wiki.agemni.com/Getting_Started/APIs/Agemni_CMS_Sync#Method_details Really could use any help anyone can offer: Hello All, I'm working with a SOAP WSDL API for the first time, i need to send off some params to the server so it returns the data i'm after, i've read the SoapClient manual and looked at a few tutorials but I can't seem to work out how to actually send the data. I have been provided a sample XML document of how the request should be formatted which I have attached. All I have worked out so far is how to run the client: Code: [Select] $client = new SoapClient($url); The request XML the server is looking for is as follows: Code: [Select] <?xml version="1.0" encoding="utf-8"?> <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <ARN_ReadRQ TransactionIdentifier="f8f766bb-87c0-42c0-83d5-29416b8477b7" TimeStamp="2007-07-31T14:33:52.1051647-07:00" EchoToken="Retrieve" Version="1.0" xmlns="http://www.domain.com/"> <POS> <Source> <RequestorID ID="Username" MessagePassword="Password"/> </Source> </POS> <ReadRequests> <ReadRequest> <UniqueID ID="1020-322162" Type="14"/> </ReadRequest> </ReadRequests> </ARN_ReadRQ> </s:Body> </s:Envelope> I am under the assumption this stuff goes in an array? If so how do I format it and how do I send it across? Any help greatly appreciated, Cheers. hello, i want to create a client login system so when they use there login it redirects them to a page only for them, is this possible? i am using the following code but it only re-drirects them after login to the "index.php" page not the 2nd user to "Harts.php", what am i doing wrong?, thanks <?php $usernames = array("admin","admin2"); $passwords = array("admin","admin2"); $page = array("index.php","Harts.php"); for($i=0;$i<count($usernames);$i++) { $logindata[$usernames[$i]]=$passwords[$i]; } $found = 0; for($i=0;$i<count($usernames);$i++) { if ($usernames[$i] == $_POST["username"]) { $found = 1; } } if ($found == 0) { header('Location: login.php?value=fail'); exit; } if($logindata[$_POST["username"]]==$_POST["password"]) { session_start(); $_SESSION["username"]=$_POST["username"]; header('Location: '.$page); exit; } else { header('Location: login.php?value=fail'); exit; } ?> Well, I'm trying to connect to this webservice but not getting any useful data returned. My code is as follows: <?php // Connect to agwebservice/AgemniLogin $agLogURL = "https://www.agemni.com/_snet/AgemniLogin.asmx?WSDL"; $myLogin->dn = "myDN"; $myLogin->username = "myUserName"; $myLogin->password = "myPassword"; $agLogin = new SoapClient($agLogURL); $agLoginResults = $agLogin->aglogin($myLogin); echo '<h2> AgemniLogin Connection: </h2>'; echo '<p style="color:red"> $agLogin { soap client - agemni session login } </p>'; echo '<p style="color:blue"> print_r: </p>'; print_r($agLogin); echo '<p style="color:blue"> var_dump: </p>'; var_dump($agLogin); echo '<hr>'; // get cookie information from $agLogin session $agCookie = $agLogin->_cookies; echo '<p style="color:red"> $agCookie = $agLogin->_cookies</p>'; echo '<p style="color:blue"> print_r: </p>'; print_r($agCookie); echo '<p style="color:blue"> var_dump: </p>'; var_dump($agCookie); echo '<hr>'; $agSession = $agCookie[AGSESSION]; echo '<p style="color:red"> $agSession = $agCookie[AGSESSION]</p>'; echo '<p style="color:blue"> print_r: </p>'; print_r($agSession); echo '<p style="color:blue"> var_dump: </p>'; var_dump($agSession); echo '<p style="color:green"> $agSession[0] = '; echo $agSession[0]; echo '</p>'; echo '<p style="color:green"> $agSession[1] = '; echo $agSession[1]; echo '</p>'; echo '<p style="color:green"> $agSession[2] = '; echo $agSession[2]; echo '</p>'; echo '<hr>'; // now connect to agwebservice/ADBAccess echo '<h2> Connect to Agemni Data Access Service ADBAccess</h2>'; $agDataURL = "http://www.agemni.com/_anet/ADBAccess.asmx?WSDL"; $agDataClient = new SoapClient($agDataURL); echo '<p style="color:red"> $agDataClient { soap client - agemni Data Connection } </p>'; echo '<p style="color:blue"> print_r: </p>'; print_r($agDataClient); echo '<p style="color:blue"> var_dump: </p>'; var_dump($agDataClient); echo '<hr>'; // set cookie information for $agDataClient echo '<p style="color:green"> try setting cookies - $agDataClient->_cookies = $agCookie </p>'; $agDataClient->_cookies = $agCookie; echo '<p style="color:green"> then look at contents of $agDataClient again </p>'; echo '<p style="color:red"> $agDataClient { soap client - agemni Data Connection } </p>'; echo '<p style="color:blue"> print_r: </p>'; print_r($agDataClient); echo '<p style="color:blue"> var_dump: </p>'; var_dump($agDataClient); echo '<hr>'; echo '<p style="color:red"> $agDataSet = $agDataClient->getCMSData($agDataParams) </p>' ; $agDataParams->opName = 'appointment'; $agDataParams->startDate = '12/29/2010 12:01:00 AM'; $agDataParams->endDate = '12/29/2010 4:00:00 PM'; $agDataSet = $agDataClient->getCMSData($agDataParams); echo '<p style="color:blue"> print_r($agDataSet) </p>'; print_r($agDataSet); echo '<p style="color:blue"> var_dump($agDataSet) </p>'; var_dump($agDataSet); echo '<hr>'; $agDataResult = $agDataSet->getCMSDataResult; echo '<p style="color:red"> $agDataResult = $agDataSet->getCMSDataReult </p>'; echo '<p style="color:blue"> print_r($agDataResult)</p>'; print_r($agDataResult); echo '<p style="color:blue"> var_dump($agDataResult)</p>'; var_dump($agDataResult); echo '<hr>'; // do var_dump of $agLogin->__getLastResponse echo '<p style="color:green"> var_dump($agLogin->__getLastResponse()) </p>'; var_dump($agLogin->__getLastResponse()); // do var_dump of $agDataClient->__getLastResponse echo '<p style="color:green"> var_dump($agDataClient->__getLastResponse()) </p>'; var_dump($agDataClient->__getLastResponse()); ?> Below you will find the resulting output: AgemniLogin Connection: $agLogin { soap client - agemni session login } print_r: SoapClient Object ( [_soap_version] => 1 [sdl] => Resource id #4 [httpsocket] => Resource id #5 [_use_proxy] => 0 [httpurl] => Resource id #6 [_cookies] => Array ( [AGSESSION] => Array ( => AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A== [1] => / [2] => www.agemni.com ) ) ) var_dump: object(SoapClient)#2 (6) { ["_soap_version"]=> int(1) ["sdl"]=> resource(4) of type (Unknown) ["httpsocket"]=> resource(5) of type (stream) ["_use_proxy"]=> int(0) ["httpurl"]=> resource(6) of type (Unknown) ["_cookies"]=> array(1) { ["AGSESSION"]=> array(3) { => string(56) "AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A==" [1]=> string(1) "/" [2]=> string(14) "www.agemni.com" } } } $agCookie = $agLogin->_cookies print_r: Array ( [AGSESSION] => Array ( => AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A== [1] => / [2] => www.agemni.com ) ) var_dump: array(1) { ["AGSESSION"]=> array(3) { => string(56) "AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A==" [1]=> string(1) "/" [2]=> string(14) "www.agemni.com" } } $agSession = $agCookie[AGSESSION] print_r: Array ( => AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A== [1] => / [2] => www.agemni.com ) var_dump: array(3) { => string(56) "AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A==" [1]=> string(1) "/" [2]=> string(14) "www.agemni.com" } $agSession[0] = AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A== $agSession[1] = / $agSession[2] = www.agemni.com Connect to Agemni Data Access Service ADBAccess $agDataClient { soap client - agemni Data Connection } print_r: SoapClient Object ( [_soap_version] => 1 [sdl] => Resource id #9 ) var_dump: object(SoapClient)#5 (2) { ["_soap_version"]=> int(1) ["sdl"]=> resource(9) of type (Unknown) } try setting cookies - $agDataClient->_cookies = $agCookie then look at contents of $agDataClient again $agDataClient { soap client - agemni Data Connection } print_r: SoapClient Object ( [_soap_version] => 1 [sdl] => Resource id #9 [_cookies] => Array ( [AGSESSION] => Array ( => AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A== [1] => / [2] => www.agemni.com ) ) ) var_dump: object(SoapClient)#5 (3) { ["_soap_version"]=> int(1) ["sdl"]=> resource(9) of type (Unknown) ["_cookies"]=> array(1) { ["AGSESSION"]=> array(3) { => string(56) "AW1GerFHiTjs7kCPrE++rZE/ATSCqFLaUqeR6HNzzVIEBV3jF2MO6A==" [1]=> string(1) "/" [2]=> string(14) "www.agemni.com" } } } $agDataSet = $agDataClient->getCMSData($agDataParams) print_r($agDataSet) stdClass Object ( [getCMSDataResult] => stdClass Object ( [any] => 12/29/2010 12:01:00 AM12/29/2010 4:00:00 PM ) ) var_dump($agDataSet) object(stdClass)#7 (1) { ["getCMSDataResult"]=> object(stdClass)#8 (1) { ["any"]=> string(296) "12/29/2010 12:01:00 AM12/29/2010 4:00:00 PM" } } $agDataResult = $agDataSet->getCMSDataReult print_r($agDataResult) stdClass Object ( [any] => 12/29/2010 12:01:00 AM12/29/2010 4:00:00 PM ) var_dump($agDataResult) object(stdClass)#8 (1) { ["any"]=> string(296) "12/29/2010 12:01:00 AM12/29/2010 4:00:00 PM" } var_dump($agLogin->__getLastResponse()) NULL var_dump($agDataClient->__getLastResponse()) NULL it should be returning data somewhere in $agDataSet or $agDataResult, but there is no data except what I submitted. I'm not certain I'm setting the cookies right, or what I might be doing wrong here. Again, the documentation for their webservice is he http://wiki.agemni.com/Getting_Started/APIs/Agemni_CMS_Sync Near the bottom is an example of how to access the service using vb.net and at the bottom is an example given in Python. Not sure if they provide any additional insight, I don't do python or VB.Net so they are little help to me. Any help would be greatly appreciated. Hi This is for a simple email client. I am trying to create a delete button that deletes a message when in message view from the MySQL database. Bellow is what I have so far. Currently it sends an alert confirming the message has been deleted and goes back to the inbox view where, it is evident that nothing has been deleted. Even when I log out then back in, the message is still there. Code: [Select] // This is how I call the JavaScript function in the html page: <input type="button" value="Delete" onclick="deleteMessage();" /> // This is the relevant JavaScript: /* ~~~~~~~~~~~~~~~~~~~~~~~~~~ Functions used to Delete a message ~~~~~~~~~~~~~~~~~~~~~~~~~~ */ var requestDlt = false; // for the message to delete /* I created my own addition PHP script that, if correct, should delete a message when in message view */ function deleteMessage(mailNumber) { var url = "delete.php?mailID="+mailNumber; // assign to the url if (window.ActiveXObject) // if the users window matches this { // then requestDlt = new ActiveXObject("Microsoft.XMLHTTP"); // create a new ActiveXObject } else if (window.XMLHttpRequest) // else if the window matches this { // then requestDlt = new XMLHttpRequest(); // the global variable is an XMLHttpRequest } if (requestDlt!=null) // if the request exists { requestDlt.onreadystatechange=RequestFunctionDelete; // when ready envoke RequestFunctionMessage requestDlt.open("GET",url); // the request will now open the assigned url requestDlt.send(null); // send the request } } function RequestFunctionDelete() { if (requestDlt.readyState==4) // if all has been sent { // and if (requestDlt.status==200) // if it is all OK { /* if in message view, hide it, and show inbox */ if (document.getElementById("messageView").style.display!="none") { var response=requestDlt.responseText; // the variable response will hold the response text alert(response); // display the response to the user $("#messageView").fadeOut(1000, function() // hide message { $("#inboxBox").fadeIn(1000); // show inbox }); } else { // else /* Warn user they are unable to access button in this view */ alert("select a message you would like to delete"); } } } } // And lastly, here is the PHP Script that is called: <?php header('Content-Type: text/xml'); header("Cache-Control: no-cache, must-revalidate"); $dbhost = 'localhost'; $dbuser = 'cjc16'; $dbpass = 'cjc16'; $dbname = 'cjc16'; $dbtable = 'mail'; $id=$_GET["mailID"]; $con = mysql_connect($dbhost, $dbuser, $dbpass); if (!$con) { die('Could not connect: ' . mysql_error()); } $dbselect = mysql_select_db($dbname,$con); $sql="DELETE FROM $dbtable WHERE mailID='$id'"; $result = mysql_query($sql); if ($result) { echo "Deleted"; } else { echo 'Unable to delete'; } mysql_close($con); ?> Mod edit: [code] . . . [/code] tags added. I'm in the habit of verifying input client side. For example, there is a field to enter a number, and I ensure that it is within a particular range using Javascript. My backend PHP code does not do such checking... Is this bad? Should I be doing checking using my backend code and send a response back to the client to display a message? Admittedly, I avoid it, since it's a little extra work -- well more extra than just javascripts, IF-THEN-ALERT type statement. Hello guys. I was thinking on posting this under the mysql thread. but i think this can be solved by php.. anyway, i want to dump mysql data on the client side whenever a user logs out. how can i do this? thanks in advance. |