PHPWord configuration issue - php

I am having problem running script of PHPWord.
I am trying to run sample example. Text.php after running it doesn't show anything. I checked it loads class successfully. Documentation.
I would like to able to run script anyone has this problem.

This is what i did -
Downloaded PHPWord_0.6.2_Beta.zip from Download link.
Extracted the zip under htdocs/core/phpword.
Created swap.php and pasted the whole code what was mentioned at Link
Commented, this is it was showing error.
//$myTextElement->setBold();
//$myTextElement->setName('Verdana');
//$myTextElement->setSize(22);
Now i run swap.php file and helloWorld.docx successfully created. You can flag a message if you want in that file. Let me know if you have any query.

Related

Can I use a PHP "index" page with AWS Amplify?

I am experimenting with using AWS. To be specific, I am following the tutorial at this link:
https://aws.amazon.com/getting-started/hands-on/build-web-app-s3-lambda-api-gateway-dynamodb/module-three/?e=gs2020&p=build-a-web-app-two
I have tried to add empty PHP tags to the start of the file and renamed the file to index.php instead of the index.HTML of the tutorial. I did a full sequence of refreshing the web app resources and deploying the app on the Amplify console. It did not work. I tried only using the HTML code on index.php and it still did not work. I put back the PHP code, added an echo statement echo "<h1>PHP Code Ran</h1>"; but renamed the file to index.html and it did render. Granted, there was an error in the text output. It also wrote the ending semi-colon and ending quotation, but it worked.
Is there any way for me to use a file named index.php as the home page of a web app using AWS amplify?
A PHP file isn't just an HTML file with a different name: you need to have a server somewhere that's running PHP which will look at the PHP code and run it.
If you're just uploading files to S3, that's not going to happen, the file is just going to be sent straight to the browser, regardless of what you call it and what you put in it.
Putting <?php echo "<h1>PHP Code Ran</h1>"; ?> into a file "worked" only in the sense that when you opened the page in the browser, you saw your browser's best attempt to interpret that as HTML. If you go to "View Source", you'll see that the file is exactly what you uploaded to S3, no PHP has run at all.
If you want to write a PHP application, you need to understand how to run PHP - most likely on an EC2 server, but it could also be in a Fargate container, or something even fancier like bref which lets you run PHP in a Lambda function.

Downloading file from external api in laravel

I am new to using APIs on laravel. I read through PHP GuzzleHttp, but i couldnt comprehend how to corelate it with ReportingCloud. I am trying to use
ReportingCloud Docs from https://docs.reporting.cloud/docs/chapter/introduction/whatisreportingcloud . Having followed the documentation, on https://docs.reporting.cloud/docs/chapter/introduction/first page shows generation a pdf version of invoice. i still dont get the code behind downloading of the pdf file. I tried checking if my template file exist which shows postive. i try using https://docs.reporting.cloud/docs/endpoint/document/merge on merging data to your template and it works fine.
my problem is how to get those files downloaded on my computer

Create and Download Zip File is printing garbage value on the screen

It is a follow up question to my previous post : https://stackoverflow.com/questions/20350947/php-readfile-printing-garbage-value-on-the-screen
I am creating a PHP file and then trying to download it.
What's happening is, When I create and then download, it prints garbage value on the screen.
However, If I just download the same zip file, it works perfectly fine.
My guess is, that the zip file might not be created when it tries to download it ?
Can you please suggest me, where I am going wrong with this?

PHP post.php mystery

I have a weird unexplainable phenomenon going on.
I downloaded some source code from a website, a basic PHP script. It came with an SQL to reference numbers as part of the script.
I uploaded the file called post.php and SQL file to my server and ran it - but - instead of executing the code in the PHP file, it loads the content of the webpage of the author of the source code. and stays on my server URL.
The code in the file has nothing to do with the author's site, or graphics or links or redirects or anything.
EVEN IF I delete the entire contents of the post.php file, run the empty file and it STILL LOADS CONTENT from the author's website, where I downloaded it from.
Refreshed browser, restarted, reloaded, you name it. How is this physically possible?
-----UPDATE
In addition when I try renaming PHP files on my server, they become permanently broken "oops broken link" error.
It would be very helpful if you could post some more specific details about what the script was, etc. But, here is my guess. Firstly, make sure that your web server is not doing any caching. If the problem persists, try getting rid of the post.php file itself. Then, I would check to see if the PHP script has created any HTML/PHP files on its own. If all else fails, try going into the code that you downloaded and see what its doing.

Need help with uploading files using the Valums ajax upload script

No matter what I change in this script, when I go to upload the file, the page is looking for the action do-nothing.htm. This is what the ACTION of the plugin is set to in the downloaded example, but I have changed it.
I have also changed some lines in the Javascript to see if I could get something working, but nothing. In fact I can't seem to find any reference to do-nothing.htm yet the console still gives me a 404 error do-nothing.htm not found. Any ideas?
the example works.

Categories